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:4567/topic/2863/link-to-anchor-from-another-page/4
Also you can search the forum for the topic anchor links.
Best!
Marius
I don't answer or check forum DMs, please just post on the forum.
Before you post:
Use the Search Feature. Maybe there is already a solution to your issue.
1. Update Lay Theme and all Lay Theme Addons
2. Disable all Plugins
3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
4. Now see if your problem solved itself
5. Go here, see if your problem is listed here:
Troubleshooting
When you post:
1. Post a link to where the problem is
2. If the problem is difficult to explain, post screenshots / link to a video to explain it