Hello!
I couldn't find anything on this specific problem so I post here.
I used the code for anchor scroll animations found on this website:
<script>
window.laytheme.on('newpageshown', function(){
if(window.location.hash.length > 0){
var id = window.location.hash;
if(jQuery(id).length > 0){
jQuery('html, body').animate(
{ scrollTop: jQuery(id).offset().top-70 },
{ duration: 1200 });
}
}
});
</script>
In the beginning everything worked fine but after some time it stopped working for my mobile site and I could not explain why.
My main page is a category page which links to a page with all projects. It should scroll to the clicked project right away with a link like this: [https://benjaminmaier.it/portfolio/works/#mzw](link url)
I know there is a slash before the hashtag but it works for the desktop site. Tested on different mobile browsers and resized desktop browsers. The link just leads to the top of the page with all projects.
Anyone knows a solution?
Thanks and kind regards,
Ben