Scrollify icon indicating copy to clipboard operation
Scrollify copied to clipboard

Anchor links from URL

Open clselin opened this issue 8 years ago • 3 comments

I'm trying to have a menu link in my site that goes to a specific scrollify section, eg. mywebsite.com/about#our-work.

If the user clicks this menu link on the page in question I'm going to use some javascript to capture the href and use the scrollify move function, which is all working fine.

However if they click this link from another page on the site, the anchor link doesn't work. They end up at mywebsite.com/about#our-work but the page is stuck at the top, looking at the first scrollify section, instead of #our-work.

Also scrollify isn't enabled on mobile, so I need to be able to use nromal anchors relating to section IDs for mobile, but scrollify section names for desktop, I guess?

Is there something I need to do when I init scrollify to make it respect an anchor tag in a url?

clselin avatar May 18 '18 02:05 clselin

Having the same issue, any updates?

df165 avatar May 31 '19 16:05 df165

If anyone else runs into this issue, a quick fix i worked up is to capture the anchor link on page loads var type = window.location.hash.substr(1); disable scrollify then enable it again after a 200ms timeout, and use the move function setTimeout(function(){ $.scrollify.enable(); $.scrollify.move("#" + type); }, 200); Inside $(document).ready(function(e){}

df165 avatar Jun 04 '19 10:06 df165

If anyone else runs into this issue, a quick fix i worked up is to capture the anchor link on page loads var type = window.location.hash.substr(1); disable scrollify then enable it again after a 200ms timeout, and use the move function setTimeout(function(){ $.scrollify.enable(); $.scrollify.move("#" + type); }, 200); Inside $(document).ready(function(e){}

This is not working

jayakumardeveloper avatar Nov 17 '23 07:11 jayakumardeveloper