If I have a div that is overflowing, is there a way I could call a jquery function to scroll it down 60px or something?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Yes you can use ScrollTo plugin.
UPDATE Seems like link is broken now. New link here
回答2:
Or, simply use the scrollTop() jQuery API call.
回答3:
mine is going like this:
var offset = item.position().top;
if (offset < 0 || offset > parent.height()) {
if (offset < 0)
offset = parent.scrollTop() + offset;
parent.animate({ scrollTop: offset }, 300);
}