HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Why does this expanding list always jumps to top of page?
Post new topic   Reply to topic    HTML Help Forum Index -> DHTML
View previous topic :: View next topic  
Author Message
langba



Joined: 21 Apr 2008
Posts: 6

PostPosted: Mon Apr 21, 2008 4:06 am     Why does this expanding list always jumps to top of page? Reply with quote

Once the list expands longer than what is displayed in the browser window, the list jumps to the top. Grrr!

www.freewebs.com/softwarelocations

I am no JavaScript wizard by any means. I got the code from Inside Dynamic HTML by Scott Isaacs, page 318, Expanding and Collapsing Outlines.

I would guess that the var pos = 0; has everything to do with it but my limited JS experience has not allowed any of my modifications to work without the dreaded A Runtime Error has occured.

Many, many thanks in advance for assistance with this!
langba



Joined: 21 Apr 2008
Posts: 6

PostPosted: Tue Apr 22, 2008 8:14 am     Reply with quote

I decided to get my own domain.

The new site is www.softwarelocations.com

A colleague tells me the behavior of jumping to the top of a page is because of this tag: <a href="#">. The example of an expanding/collapsing list had this identical tag. When I take out the # character and use only <a href="">, the expanding stops working completely.

What does <a href="#"> do with the # character and what are my alternatives?

Thanks
langba



Joined: 21 Apr 2008
Posts: 6

PostPosted: Tue Apr 22, 2008 10:12 am     Reply with quote

Got it...

Change <a href="#"> to just <a>. In the css, add a{cursor:hand;} otherwise you won't see a visual cue that you are hovering over a link, even though the link will still work without the hand.
sticks464



Joined: 31 Dec 2006
Posts: 1179

PostPosted: Tue Apr 22, 2008 7:06 pm     Reply with quote

Quote:
A colleague tells me the behavior of jumping to the top of a page is because of this tag: <a href="#">. The example of an expanding/collapsing list had this identical tag. When I take out the # character and use only <a href="">, the expanding stops working completely.

What does <a href="#"> do with the # character and what are my alternatives?


There must be a character/characters inside the quotes for the link to display as a link. I use <a href="#nogo"> and have no trouble.
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> DHTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial