Dynamic Top of Page?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
wendy
Beginner
Beginner
Posts: 4
Joined: Sat Aug 02, 2003 4:16 pm

Dynamic Top of Page?

Post by wendy »

I would like to add a top of page menu that follows the user down the page. When the user clicks on the "Top of Page" menu item it will take them back up to the top.

Very simple right? Well, my problem is that I want this script to run on every page. How do I specify the top of page in the .js file so that it will take me to top of whatever page the user is viewing without having to create a separate .js file for each page?

Thanks

Wendy
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Have the top of link page be a # symbol. So the link would be url="#". The pound symbol, or hash symbol as its known, simply means to move to the top of the current page. Its used to have pages load at specific parts of the page, called an anchor, but thats another story. Just a # should work for any page.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
wendy
Beginner
Beginner
Posts: 4
Joined: Sat Aug 02, 2003 4:16 pm

Post by wendy »

Thanks for your reply.

I tried what you suggested and the link doesn't go anywhere when I use "#". In fact I went to the sample pages where this # is also used and the link doesn't respond either. It just show a "#" in the URL bar at the bottom of my browser, but nothing happens. I'm using Explorer 6...any thoughts?

Thanks again.

Wendy
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Wendy,
I also need this, and it is an anchor link. Did you figure it out? I've tried everything I can think of to do this, I even tried # target=_top it does function as a link but it takes me back to the main index/entry page.

Ruth
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Wendy,
Thank Dave for the help, he figured it out for me on the v3 menu. This is what I put and it works;

,"Back to Menu","#top",,,1


of course you may have more things in the code, but it's the "#top" that works.

Ruth
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Wendy, yeah thanks to Ruth for mentioning that. Just so you know, you don't have to put an anchor in your paged called top for this to work, just anything after the # symbol will work. The reason is the browser will scroll to the top of the page if cannot find the anchor mentioned in your link. Best of luck.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply