/    Sign up×
Community /Pin to ProfileBookmark

Jumping to location within page

I’m working on a page that has a navigation list made up of images that link to corresponding pages which appear in an inline frame lower on the page. Right now they link just fine with the html I’m using, but the inline frame is so low on the page that its not visible without scrolling down. When an image is clicked, I need the page to ‘jump’ down to the spot where the inline frame is located. I don’t think there’s any way I could do this with html but I was thinking javascript could possibly work. Any suggestions??

to post a comment
JavaScript

10 Comments(s)

Copy linkTweet thisAlerts:
@senshiJan 02.2005 — you can get the document to 'scrollTo' if it the right one IM thinking of, so you can roughly scroll the document to that point with javascript.

In HTML you would use a <a name="somename"></a> type anchor reference that when the URL with #somename on the end of the Address URL will load up that page and jump to that point on the page.
Copy linkTweet thisAlerts:
@JPnycJan 02.2005 — Yeah, use an anchor tag. JS should never be used for anything that HTML can do.
Copy linkTweet thisAlerts:
@CharlesJan 02.2005 — [i]Originally posted by 4thorder [/i]

[B]http://www.programmingtalk.com/showthread.php?t=15462 [/B][/QUOTE]
Except that it doesn't work ine in ten times which is not acceptable for navigation.
Copy linkTweet thisAlerts:
@4thorderJan 02.2005 — I can totally accept criticism in fact expect it and use it to improve my code. (not after being right just doing right)

[B]However[/B] not without an explanation.

I have tried this in three diferent browsers a number of times and it always works.

What breaks it? Earlier browser versions? Other code in page?

PLease clarify and thanks for the feecback.


Mike
Copy linkTweet thisAlerts:
@JPnycJan 02.2005 — Well I didn't try it so I don't know what CHarles is referring to, but as a general rule, it's not advisable to use any scripting for something a formatting language can do. It's just bad practice. Anchor tags were designed to do this, as well as navigate to a new page. And you can't disable them. More and more users surf the web with scripting disabled.
Copy linkTweet thisAlerts:
@4thorderJan 02.2005 — Point well made and thank you very much for the information - I did learn something today.

Neverthelss, I combined script with the use of an anchor tag to accomplish the task of changing the IFRAME content AND moving to another location on the page. If this shouldnt be done with scripting (and the anchor tag) then how?

Mike
Copy linkTweet thisAlerts:
@JPnycJan 02.2005 — Man, I'm having a rough day. NY's eve remnants, I hope. senshi already answered how to do it with HTML
Copy linkTweet thisAlerts:
@senshiJan 03.2005 — Here is a bit of HTML from my Girfriends website which uses the HTML version of jumping to a page anchor.


The calling page has the Highlighted...
[SIZE=1]



<p><strong>In the meantime, have a merry merry Christmas!</strong></p>
<p><font face="Arial, Helvetica, sans-serif">
<strong>
<a [B]href="more_details.html[COLOR=red]#boxday[/COLOR]"[/B]>Click
for details</a></strong></font><br>
</p>
</font></td>
</tr>
<tr>


[/SIZE] [/QUOTE]


In the target page the highlighted is the anchor

[SIZE=1] </font></strong></div></td>

</tr>

<tr>

<td>[B]<a name="[COLOR=red]boxday[/COLOR]"></a>[/B]<strong><font size="3"><br>

<br>

</font></strong></td>

</tr>

[/SIZE]
[/QUOTE]


The target page can also be the same page, all you do is ommit the URL in the link but keep the #reference portion.
Copy linkTweet thisAlerts:
@katiejauthorJan 03.2005 — I tried the different things recommended and I still can't get it to jump.

I first tried using some javascript but I obviously didn't do that right. You can see my attempt at http://www.programmingtalk.com/showthread.php?t=15462

The bit about using anchor tags seemed simple and practical, but I can't get it to jump: I changed it so my link was in this format <a target="I2" href="News.htm#key"> the "I2" being my inline frame; and my anchor point as <a name="key"></a>. Is that not correct?

Please help! You can view the page I'm working on at http://www.minnsci.com/Main.htm[/url]
×

Success!

Help @katiej spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...