开发者

For a DIV with scrollbars, is it possible to make that div scroll all the way to the bottom, using JQuery?

开发者 https://www.devze.com 2023-03-01 02:21 出处:网络
How would you do tha开发者_开发技巧t using JQuery?Try manipulating the scrollHeight: http://kisdigital.wordpress.com/2009/11/12/using-jquery-to-scroll-to-the-bottom-of-a-div/

How would you do tha开发者_开发技巧t using JQuery?


Try manipulating the scrollHeight:

http://kisdigital.wordpress.com/2009/11/12/using-jquery-to-scroll-to-the-bottom-of-a-div/

$("#myDiv").attr({ scrollTop: $("#myDiv").attr("scrollHeight") });

Or if you want it animated:

$("#myDiv").animate({ scrollTop: $("#myDiv").attr("scrollHeight") }, 3000);


I'd use the jQuery ScrollTo pluging

$('div').scrollTo(...);//all divs

http://flesler.blogspot.com/2007/10/jqueryscrollto.html

0

精彩评论

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

关注公众号