auto scroll to bottom of page with jquery

前端 未结 8 1476
自闭症患者
自闭症患者 2020-12-29 05:30

How can i auto scroll to bottom of page with jquery becuase i am requesting xmlhttp to update content of page

8条回答
  •  长发绾君心
    2020-12-29 05:54

    A lot of the scrollHeight implementations didn't work for me, offsetHeight seemed to do the trick.

    Pretty sure that scrollHeight tries to move it to the bottom of the height of the static element, not the height of the scrollable area.

    var pane = document.getElementById('pane');
    pane.scrollTop = pane.offsetHeight;
    

提交回复
热议问题