Scroll smoothly to specific position using jQuery
How can I scroll smoothly to specific positi开发者_运维技巧on using jQuery ?
I could scroll to top smoothly using jQuery with this code :$("#id").animate({"scrollTop": $("#id").scrollTop() + 100});
But now I want to scroll to position for example 200 of a page.
try this:
$('html, body').animate({scrollTop: 200}, "slow"); //you can change "slow" to a number amount or remove it (default is 500)
jsfiddle: http://jsfiddle.net/UPRkm/
i think you can do it by height....
$("#id").animate({
height: '200px'
});
精彩评论