问题
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