开发者

How to avoid page scroll-up when a link gets clicked

开发者 https://www.devze.com 2023-04-08 10:58 出处:网络
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 w开发者_开发技巧ay up. How to avoid this ?you have to

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 w开发者_开发技巧ay up. How to avoid this ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号