• 0

Custom Scroll Spy Nav ID name

Question

Posted · Report post

Currently if I want to deep link to a scroll spy tab, it looks like this. 

/#spyID1

 

Is there some way to customize this without having to add some custom anchors into the html? 

Thanks

Share this post


Link to post
Share on other sites

5 answers to this question

  • 0

Posted · Report post

If you want to deeplink to a section of your page using a url like: http:myshop#Video it doesn't work, even though video is the title.

 

Instead, we must use /#spyID3 if you want to link to that section of the page. 

 

It's a bit messy/ugly to have spyID3 instead of the title. I can build an anchor into the section with the proper name, but it's an extra bit of code that I'd rather not have to use if there is another way to just use the title as an anchor. 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

You do not use anchors with Scroll Spy, the documentation shows you how to use Scroll Spy. In order to populate the menu, you need to add some HTML along with the title attribute.

 

If you want to target a specific section using Scroll Spy, then you will need to use HTML above the section you wish to target. The simplest way would be to follow the instructions on the Scroll Spy documentation I linked you and add that HTML to a MediaBox which has been positioned above the section you wish to target.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Thanks Danny. I already had it working fine, my question was only about anchoring. 

 

I will build custom anchors. Thanks.

 

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

OK, no problem.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now