簡體   English   中英

加載ajax后滾動到頁面末尾

[英]Scroll to end of page after load ajax

function chat (){
    $.ajax({
        url: "chat_motor.php",cache: false,success: function(html){
            $("#chat").html(html);
        },
    });
}
setInterval (chat, 1000);

我想在加載chat_motor.php后滾動到頁面末尾運行此代碼后如何向下滾動?

你可以這樣做:

window.scrollTo(0,document.body.scrollHeight);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM