How to scroll to top of page with JavaScript/jQuery?

Is there a way to control browser scrolling with JavaScript/jQuery? When I scroll my page half way down, then trigger a reload, I want the page to go pack to the top, but instead it tries to find the last scroll position. So I did this: $(‘document’).ready(function() { $(window).scrollTop(0); }); But no luck. EDIT: So … Read more

Disable Scrolling on Body

I would like to disable scrolling on the HTML body completely. I have tried the following options: overflow: hidden; (not working, did not disable scrolling, it just hid the scrollbar) position: fixed; (this worked, but it scrolled completely to the top, which is unacceptable for this specific application) I was unable to find any alternatives … Read more

Prevent scrolling of parent element when inner element scroll position reaches top/bottom?

I have a little “floating tool box” – a div with position:fixed; overflow:auto. Works just fine. But when scrolling inside that box (with the mouse wheel) and reaching the bottom OR top, the parent element “takes over” the “scroll request” : The document behind the tool box scrolls. – Which is annoying and not what … Read more