2017-07-06 45 views
0
window.scrollTo(0,0); 

期望的結果:頁面向上滾動到頂部window.scrollTo()不工作

試了一下連接到按鈕點擊沒有任何反應。

我有頁面的信息,當用戶點擊底部的下一個/上一個頁面按鈕時,我希望窗口回滾到頂部。

這裏怎麼回事?我們應該在App Maker中使用其他一些App Maker方法嗎?

回答

1

退房:Google Apps Script UI: Scroll to top of screen

我沒有試過,但是從這個帖子是這樣的:

var element = app.currentPage.getElement(); 
element.scrollTop = 0; 
// (And if you need left as well) 
element.scrollLeft = 0;