Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > scroll position is changed when style is changed?

Reply
Thread Tools

scroll position is changed when style is changed?

 
 
mxbrunet
Guest
Posts: n/a
 
      11-03-2006
When I scroll down my page and trigger js that changes a div's
visibility to 'visible' and display to 'block' the page gets
repositionned to the top (i.e. automatically scrolls to the top) and I
have to scroll back down.

How can I avoid this?

 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      11-03-2006
mxbrunet a écrit :
> When I scroll down my page and trigger js that changes a div's
> visibility to 'visible' and display to 'block' the page gets
> repositionned to the top (i.e. automatically scrolls to the top) and I
> have to scroll back down.


My test doesn't do what you say.

If you call your function in a link don't forget return false;

<a href="#"
onclick="fToHideShow('div_1')";
return false;">
show/hide div 1
</a>


> How can I avoid this?


Example ?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enable Scroll up and scroll down in CR-report Sathiamoorthy ASP .Net 1 11-28-2006 11:42 PM
change the scroll speed of a scroll pane? Kevin Java 1 02-05-2005 09:42 AM
prevent mouse scroll to scroll in a dropdownlist nicholas ASP .Net 0 12-07-2004 11:26 AM
Getting DOM element position(style.left and style.top) Amir Hardon Javascript 0 05-31-2004 01:18 AM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57