Link to an Anchor on another page
-
Hi there guys,
I know there are several threads on this topic, but I am still having problems linking to an anchor on a different page to the original link.
The company icons on the home page here:
https://limelightmedia.tv/home/are all supposed to link to a specific section on the previous work page here:
https://limelightmedia.tv/previous-work/When I click each link for example #zurich a / appears before the anchor link in the navigation bar eg.
https://limelightmedia.tv/previous-work/#zurichI don't know if that is whats causing the problem...
At the moment I have the code you previously suggested in the custom head content:
<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>Any further help is massively appreciated!
Cheers! -
Dear @limelight
Did you have a look here?
Definitive guide to 'Smooth scroll to anchors from menu'
http://laythemeforum.com:4567/topic/4200/definitive-guide-to-smooth-scroll-to-anchors-from-menu/2Best!
Marius
-
-
Sure thing!
The company icons on the home page here:
https://limelightmedia.tv/home/are all supposed to link to a specific section on the previous work page here:
https://limelightmedia.tv/previous-work/When I click each link for example #zurich a / appears before the anchor link in the navigation bar eg.
https://limelightmedia.tv/previous-work/#zurichI don't know if that is whats causing the problem...
-
-
Hi there Marius,
No, not the row, Just the image icon has a link to:
https://limelightmedia.tv/previous-work#zurichAnd then there is an anchor id=zurich on the previous work page. The same for each company icon... I did just quickly try giving the row an ID on the previous work page, but still no luck...
-
Dear @limelight
I do not see here an ID which could get used as anchor:
Marius
-
Hi there @mariusjopen
The anchor is in the body of the text in the HTML...
-
Hi @mariusjopen
I have changed it so the anchor ID is the div element rather than within the html and still not working i'm afraid.![alt text]
-
Dear @limelight
to make it easy for people to understand:
Can you please paste the code which you used?Best!
Marius
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it