jQuery scrollTop() not working on 'body' element in Firefox

前端 未结 4 698
终归单人心
终归单人心 2021-01-01 15:04

I do not understand why the scrollTop() jquery function is not working on the \'body\' element on Firefox.

$(\'body\').scrollTop(0);

I fixe

4条回答
  •  Happy的楠姐
    2021-01-01 15:55

    try this:

    your div to scroll:

    and scroll top js:

    $('html,body').animate({scrollTop: $('#top').offset().top},'slow');
    

提交回复
热议问题