Blog Home  Home Feed your aggregator (RSS 2.0)  
Mayur's Blog - document.body.scrollTop and/or document.body.scrollLeft have zero values all times
 
# Thursday, April 16, 2009

If you are using master page in your asp.net project and also trying to use properties such as scrollTop and scrollLeft in your javascript then it is very likely that you might be getting property values zero; no matter hou much you scroll down or up in your web page.

To correct this error you should use document.documentElement.scrollTop instead of document.body.scrollTop. Same applies to scrollLeft as well.

Hopefully it should solve your problem as it has worked for me!. For more info refer the following page:

http://forums.asp.net/p/1234594/2374359.aspx

Thursday, April 16, 2009 5:13:12 AM UTC  #       | 
Copyright © 2022 Mayur Bharodia. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: