开发者

Div overflow scroll with scroll control - JQuery

开发者 https://www.devze.com 2023-04-05 14:11 出处:网络
I have a div that has content loaded into it. If the user tries to load different content into it I want the div to scroll to the top of itself first. 开发者_Python百科This cannot be achieved by ancho

I have a div that has content loaded into it. If the user tries to load different content into it I want the div to scroll to the top of itself first. 开发者_Python百科This cannot be achieved by anchor tags and needs a bit of JQuery.

Any ideas?

Marvellous


Just call scrollTop on the element:

$('#scrollable_div').scrollTop(0);


Try to use ScrollTo plugin for jQuery.


jQuery scrollTo will be your best friend for doing something like this

0

精彩评论

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