Pagination unwanted scroll to top of page


#1

Matrix Version: 5.5.6.0

I have an issue with pagination scrolling to the top of the page when click on either Previous, Next or any page number.

The list I have created, lives at the bottom of a long page and it poor web practice to make customers scroll every time they click on the options.

Is there a way to stop the scrolling?

Cheers, Trina


(Byrne) #2

Add an ID tag to a heading above where you would like the page to return.

if your using an asset listing the div could be…
<div > <h3 id="heading-list">My heading </h3> %asset_listing% </div>

you can add the hash to the URL
domain.com/pagelist?page=1#heading-list
All browsers will recognise this.

you may need to build the Pagination links in the asset listing rather than using the default keywords
eg:
rather than %next_page%
you would :
<a href="%next_page_href%#heading-list" > Next </a >

https://matrix.squiz.net/manuals/keyword-replacements/chapters/asset-listing

You you get unexpected results the next step would be to add Javascript to update the page scroll based on the url.