Hello
How can I make it so that when I click on pagination I can put the user back at the top of the page?
Thanks
Hello
How can I make it so that when I click on pagination I can put the user back at the top of the page?
Thanks
If you are on the same page, give an element near the top of the page an ID as in
<div id="top" class="row">
Where you want to place the link or an anchor button, link to the ID as in
<a href="#top" class="btn">Anchor Button</a>
Hello ben, thank but it’s not possible, I should be able to add it to the code below
<a href="javascript:void(0)" class="page-link" dmx-on:click="queryListe.set('offset',(page-1)*scListeProduits.data.query.limit)">{{title}}</a>
Add the Smooth Scroll component to your page. Add the ID as suggested by Ben. On the Pagination add an On Click Dynamic Event and select Smooth Scroll, and enter the #ID. Now on click you will be scrolled to the top of your page.
All good but can’t you just add to the existing on-click event of the pagination button an extra browser command scrollYTo(0) to scroll the page at the top (after the queryListe.set(…)?
browser1.scrollYTo(0)
(where browser1
is the id of your browser component)
All together:
<a href="javascript:void(0)" class="page-link" dmx-on:click="queryListe.set('offset',(page-1)*scListeProduits.data.query.limit));browser1.scrollYTo(0)">{{title}}</a>
It works fine for me
Thanks all, it’s good
Morgan