By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,629 Members | 1,716 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,629 IT Pros & Developers. It's quick & easy.

scrolling

P: n/a
I am using display:none to make a DIV disappear, this works fine, but
when I press the link to make the div disappear the browser scrolls to
the top of the page, which is very annoying. Is there any way of
stopping the browser resetting the scroll.

Thanks
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Steven Licciardi wrote:
I am using display:none to make a DIV disappear, this works fine, but
when I press the link to make the div disappear the browser scrolls to the top of the page, which is very annoying. Is there any way of
stopping the browser resetting the scroll.

Thanks


<a href="#null" onclick="hideDIV();return false;">.....

Jul 23 '05 #2

P: n/a
That fixed it, thanks.

"RobB" <fe******@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Steven Licciardi wrote:
I am using display:none to make a DIV disappear, this works fine, but
when I press the link to make the div disappear the browser scrolls

to
the top of the page, which is very annoying. Is there any way of
stopping the browser resetting the scroll.

Thanks


<a href="#null" onclick="hideDIV();return false;">.....

Jul 23 '05 #3

P: n/a
In article <be*************************@posting.google.com> ,
st**************@hotmail.com enlightened us with...
I am using display:none to make a DIV disappear, this works fine, but
when I press the link to make the div disappear the browser scrolls to
the top of the page, which is very annoying. Is there any way of
stopping the browser resetting the scroll.


Link?
Are you using <a href> type thing?
If so, return false. The browser is just following the href like a good boy.

<a href="#" onClick="functionname();return false;>linky</a>

--
--
~kaeli~
A boiled egg in the morning is hard to beat.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4

P: n/a
or other wise use
just <a href="javascript:functionname();" >linky</a>

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.