I have a page that shows artists with help of JAMegafilter, now I created a function to remember the scrollY position of that page when I navigate out of it. Then when someone navigates back to 'zoek-kunstenaar' the scrollY is set to the last known position of the user. The function looks like this:
window.onbeforeunload = function(e) {
if (window.location.href.indexOf("zoek-kunstenaar.html#sort=name&sortdir=asc") > -1) {
localStorage.setItem('scrollCookie', window.scrollY);
}
};
window.onload = function(){
if (window.location.href.indexOf("zoek-kunstenaar.html#sort=name&sortdir=asc") > -1) {
if (scrollTo != "") {
window.scrollTo(0,localStorage.getItem("scrollCookie"))
}
console.log(scrollY)
}
};
However, on the 'zoek-kunstenaar' page the scrollY blocks at either 851 or 877px. It only does this on pages where the JAMegafilter is implemented and works fine without it.
So i started looking for the function that makes 'zoek-kunstenaar' page scroll to 851/877 in the assets folder of JAMegafilter component.
Can someone indicate where to find the issue within JAMegafilter that messes around with the page scroll?