Skip to content Skip to sidebar Skip to footer

How To Avoid Page Scroll-up When A Link Gets Clicked

I have a div which is half way down the page. After I click a button, I load an image in that div. What happens is, that the page scrolls all the way up. How to avoid this ?

Solution 1:

you have to edit your click event. the simplest thing would be to return false. you could also preventDefault f.e. if you are using jquery.


Post a Comment for "How To Avoid Page Scroll-up When A Link Gets Clicked"