Previously body.scrollTop
was working in my chrome.....but suddenly body.scrollTop
is returning 0 in firefox and chrome......but returning proper value in Microsoft edge..
can anyone help me out?
Use document.documentElement.scrollTop
to return scroll position value
Update: Use both
var value = document.body.scrollTop || document.documentElement.scrollTop;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.