Scroll down to the bottom of page

0
Hi,   My requirement is to scroll down to bottom when we click on a link. How to achieve this in mendix modeller? Appreciate a prompt response.   Thanks Salma
asked
6 answers
4

Hi, you can use 

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

in javascript action past this code and call it in onclick event uisng nanoflow.

answered
3

And there is a widget for that: https://appstore.home.mendix.com/link/app/2583/Mendix/Scroll-To-Anchor

Good one in combination with this one: https://appstore.home.mendix.com/link/app/1046/Mendix/Scroll-To-Top-Button

Regards,

Ronald

 

answered
1

I added a widget called DojoXScroll to the AppStore yesterday. Reasoning behind yet another widget for scrolling next to the already mentioned ones is that all other widgets were a bit outdated, I could not get them to work directly and they are loading jQuery, which I want to refrain from.

This widget loads an extra dojox library Mendix is not loading itself by default. This extension of dojo has a function called smoothScroll which can handle nice scrolling behavior. So, what you could do is add that widget, then the library becomes available to use in your application.

After that, add some JavaScipt in an HTML snippet, something like shown in this JSFiddle:

http://jsfiddle.net/kfranqueiro/6aNrp/

The trickiest part is ensuring you are targeting the correct node and win parameters. After that, you will experience some smooth automatic scrolling ;)

answered
0

If you need to scroll on the same page it would suffice that you add an elemnt with unique id at the bottom of the page and then link to this elements id. For example, to scroll to the bottom of this page you can use 
https://forum.mendix.com/link/questions/88267#mxui_widget_DataView_1

answered
0

Try the HTMLSnippet widget with some javascript/jQuery, like (untested):
 

$('.classOfLink').on('click', function() {

    $("html, body").animate({ scrollTop: $(document).height() }, 1000);

});

 

answered
0

Javascript is very powerfull. But use Mendix whenever possible to create better maintainable apps. So here is the implemention of Andrej’ example:

Click here to scroll down to the end of this page

answered