Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Callback on scrollTop

Tags:

jquery

$("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?

like image 938
Eric Avatar asked Mar 28 '13 21:03

Eric


1 Answers

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.

like image 58
Ejaz Avatar answered Oct 27 '22 09:10

Ejaz