【发布时间】:2015-09-21 09:22:11
【问题描述】:
到目前为止,我现在拥有的指令运行良好,但并非每个页面的高度都相同,所以我想在它已经在底部时停止持续时间。
这是指令的代码:
function (scope, elem, attrs) {
$(document).on('contentchanged', '#mainText', function () {
$("html, body").animate({
scrollTop: 0
}, 0),
$("html, body").animate({
scrollTop: $(window).height()
}, 4000);
});
}
因此,例如在第一页,视图位于底部,它不能再往下走,当我转到稍微低一点的下一页时,它会连续向下滚动。
我的问题是如何阻止它滚动?
【问题讨论】:
标签: jquery angularjs directive scrolltop