scroll to the top automatically

Hi, When i am clicking on a button the position stay the same when i am opening a new page from a microflow. I cannot succeed to scroll automatically to the top in mendix, I tried a lot of things in js but nothing is working (i also try the scrollToAnchor module but it this not working either...) Someone have a practical solution please?    Thanks
3 answers

Thanks for your time,

I did manage to do what I want with these lines of code in a js snippet: 

$( ".ButtonNextPage" ).click(function() {

that scroll to the top just before the page is changing, that the only solution that worked properly for me.


Add a html/javascript widget to the page with a small piece of javascript:




Think Erwin's solution will work. But do you mean that you are on a page which is scrolled to the bottom, then click a button which opens a new page and the new page is also scrolled to the bottom? If so, this is not normal behavior. The new page should be automatically scrolled to the top.