We want to have a simple sub-navigation where the can directly jump to a section of the page, you know with <p id="something> and <a href=#something">...
A
Andreas123
@Andreas123
Posts
-
Anchor link within page -
Anchor link within pageHi,
we found a couple of posts in the forum about anchor links but nevertheless we didn't manage to get it to work.
We added a text paragraph and gave it an id="test", we set a link to #test (without the full url) and we added this snippet to the custom head section
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 }, { duration: 1200 }); } } }); </script>
But the link just opens a blank page and doesn't jump to the id?
Best
Andreas