window.scrollTo() not working

99封情书 提交于 2019-12-12 04:54:29

问题


window.scrollTo(0,0); 

Desired result: page scrolls up to top

Tried it attached to button click and nothing happens.

I have pages of information and when the user clicks on the next/previous page button at the bottom, I want the window to scroll back up to the top.

What's going wrong here? Is there some other App Maker method we're supposed to use within App Maker?


回答1:


Check out: Google Apps Script UI: Scroll to top of screen

I haven't tried this, but from this post something like:

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


来源:https://stackoverflow.com/questions/44952033/window-scrollto-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!