Forum Moderators: open

Message Too Old, No Replies

Make a link open in a certain position on the page?

         

jal425

4:43 pm on Sep 12, 2006 (gmt 0)

10+ Year Member



Is there a way to do this without having to open a new window?

I want users to click the link, and have the page open further down towards the middle of the page.

Users are looking at a grid, and if they click a link, they will want to see a new grid immediately in front of them...

I want the links to be followed by robots and recognized for PR purposes also.

Thanks

bobming

4:51 pm on Sep 12, 2006 (gmt 0)

10+ Year Member



Think this might be what you're looking for:

Say you want the page to open at a particular paragraph, you give that paragraph a specific id in the html


<html>
...
...
<p id="open_here">
blah blah blah
</p>

...
...
...
</html>

Then your link tag should look like this:


<a href="mypage.html#open_here">Click here</a>

jal425

5:08 pm on Sep 12, 2006 (gmt 0)

10+ Year Member



bobming,

Thank you so much!

It works wonders!

jal425

10:06 pm on Sep 12, 2006 (gmt 0)

10+ Year Member



I noticed sometimes when i click it goes to the correct spot, other times it ignores and goes to the top of page. If I hit backspace and click again it will usually then go to the correct position on the page.

Weird... Maybe something with my browser?
I'm using IE 6.0

jimbeetle

10:12 pm on Sep 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've never used the ID format, but if you're having problems with that you might want to set an anchor on the target page...

<a name="open-here"></a>

...then the same link as bobming spec'd.

Robin_reala

7:22 am on Sep 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jimbeetle: fwiw the <a name> method is original HTML3 method. HTML4 introduced the <anything id> method that could be used as well, and XHTML requires [w3.org] the id fragment indentifier (although a name attribute can be used as well).

penders

9:06 am on Sep 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I noticed sometimes when i click it goes to the correct spot, other times it ignores and goes to the top of page. If I hit backspace and click again it will usually then go to the correct position on the page.

Yes, I have noticed this phenomenon before as well! (Possibly just IE, but I'm not sure) Only when the page is first loaded, before it is cached - maybe when there is a delay in loading the page - but after that it's OK?!

jimbeetle

2:32 pm on Sep 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hey, thanks Robin, an old dog just learned a new trick (and one I can actually use right away).

Car_Guy

1:33 am on Sep 14, 2006 (gmt 0)

10+ Year Member



When creating links that point to the middle of a page, bear in mind that some visitors may bookmark them that way, and that same link with the anchor tag at the end can end up posted somewhere. As a result, visitors will often miss any navigation that may have been provided at the top of the page, and miss out on other things your site has to offer.

I'm not saying not to make links to specific, related information as a footnote, just not to do it any more than you need to.

[edited by: Car_Guy at 1:43 am (utc) on Sep. 14, 2006]