JQuery :: Stop Page From Jumping To The Top OnClick?.JQuery :: Stop Page From Jumping To The Top?.That is, if I have my scroll bar half way down the page, when I click on the link and run this code it jumps me back to the top as if I'm visiting for the first time.Īny ideas on how to keep it on the same spot on the page while still executing the code?ĭocument.getElementById('orderDetail').style.backgroundImage = 'url(images/subpage_odguysbg.jpg)' ĭocument.getElementById('orderDetail').style.backgroundImage = 'url(images/subpage_odgalsbg.jpg)' It's doing exactly what I want it to do, but when it runs it also 'jumps' the page back to the top. I have a piece of javascript running about mid-section on a webpage.