Restoring page scroll position with jQuery

后端 未结 6 1372
春和景丽
春和景丽 2020-12-05 17:21

I have a page operation that uses something like:

$(\'#thetable tbody\').replaceWith(newtbody);

in an ajax callback. Sometimes, if the user

6条回答
  •  死守一世寂寞
    2020-12-05 17:36

    var position= $(window).scrollTop();
    
    //some things here
    
    $(window).scrollTop(position);
    

    It worked for me in both IE8 and FF.

提交回复
热议问题