Debt Consolidation - Find jobs - Debt Consolidation - Yellowline - Lab Equipment - Kamala Harris

PDA

View Full Version : Automatically Scroll To A Div On The Landing Page


phaze3131
May 6th 2009, 5:01 am
Hey guys I have a question...

I have been doing research and can't find out how I can automatically scroll to a div id on a new page that I link to. Is this even possible?

I know I can scroll to a certain div on the same page with just #divid but what about if I am linking to say <a href="example.html">click here</a> and want them to auto scroll down to the say <Div id="cats">

thanks guys!

Travis

PoPSiCLe
May 6th 2009, 6:23 am
You make the link <a href="example.html#cats">Scroll to cats on different page</a> The #-id locator works on any page

phaze3131
May 6th 2009, 8:27 am
oh wow thank you alot!

works great!

hey random, could you get indexed for something like that? Or do the bots know that anything including and after the "#" is irrelevant?

PoPSiCLe
May 6th 2009, 12:57 pm
The part after the # is deemed irrelevant, as it is, as you say, just a pointer to either the same page, or somewhere specifically on the other page - therefore, only the actual URL is counted by bots. At least if the one who's made the bot has any knowledge whatsoever. However, the actual URL will be counted as normal, just as if you didn't have the #-tag added to it.

Glad you liked my solution, add +rep if you want :)