Anchor link within page
-
Hi,
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 -
Dear @Andreas123
what exactly do you try to achieve?``Best!
Marius -
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">...
-
Dear @Andreas123
Did you have a look in this post? http://laythemeforum.com/topic/2863/link-to-anchor-from-another-page/4
Also you can search the forum for the topic anchor links.
Best!
Marius
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login