Archived

This topic is now archived and is closed to further replies.

  • 0

Scroll Spy - How to fix the li:active

Question

Posted · Report post

Hey guys. I have the scroll spy section working in a website, but for some reason the active state is bugged. The link#5 option keeps showing as active even if I select something else, and also whenever I load the page. Is there a way to fix this?

Share this post


Link to post
Share on other sites

7 answers to this question

Posted · Report post

Hi, Like Nick stated above, the Scroll Spy wasn't mean't to be used in the way you're using it unfortunately. :(

Share this post


Link to post
Share on other sites

Posted · Report post

Nelson must have been removed from the forum because I don't see his posts in this thread.  I would also like to know how to get around this last scrollspy item staying active.  I realize it's not meant to be used with sections, but hey, what can I say?

Share this post


Link to post
Share on other sites

Posted · Report post

Sorry for the delay =[ I actually didnt get around it. For some reason scroll spy's behavior seems very random, so in that site's homepage it worked fine, but on the other pages it shows different active links. For an instance, in the page "Serviços" it natively shows the last link "premios" as active, but if you scroll down enough for the menu to stick on top, you will notice the active link gets stuck on "imobiliarios". I still dont understand why this happens.

Share this post


Link to post
Share on other sites

Posted · Report post

Heya, You have your id's and scroll headers in with empty p tags, on multiple hero units, so it really just wasn't designed to be used in this manner. The active states do work perfectly when all on one page, in a content area. That's sort of how it was designed to work anyways. Nick

Share this post


Link to post
Share on other sites

Posted · Report post

Yeah, this is weird tho. I tried using the scroll spy title on highlight sections instead of hero units, and it behaves differently. If I close the p tag the active state disappears and never shows up no matter what I click, and if I leave the p tag open, although the active state shows up, it stays static on a random link.

Share this post


Link to post
Share on other sites

Posted · Report post

Hey Nelson, I am using scrollspy incorrectly just as you are ;-) I noticed on your site you were able to get around the link showing as active. How did you end up resolving this?

Share this post


Link to post
Share on other sites