Callback on scrollTop

2020-02-07 02:47发布

$("html").scrollTop($(document).height(),function(){
    $("#page_jump_input").focus();
});

I can't get a callback function to work on the method scrollTop().

The scrolling works, but the callback wont. Where am I going wrong?

标签: jquery
1条回答
神经病院院长
2楼-- · 2020-02-07 03:26

This could solve your problem

$('html').animate({
   scrollTop: $(document).height()
}, function(){
   $("#page_jump_input").focus();
});

It uses jQuery animate as scrollTop() has no callback function.

查看更多
登录 后发表回答