문제

http://codepen.io/theandrewwest/pen/pDEIo

I'm using fullpage.js and have a section with a submenu that navigates through horizontal slides. I want to add an "active" class to the anchor corresponding to the active slide. I know the functionality is built in for navigating vertical sections using the "menu" option, and I have that working for the main nav, but it looks like I'll need to use a callback to add the class to anchors linked to horizontal slides.

I know just enough JS to get plugins working the way I want, but I'm not sure of the best way to set this up. I'm linking to the slides using "data-index" in the pen, but I plan on using custom anchors once I can get them working (no problem with sections, I just can't get them working for slides). I'm not sure if that makes any difference.

도움이 되었습니까?

해결책

Solved. I added a working example at http://codepen.io/theandrewwest/pen/fltAE.

다른 팁

You are using an old version of the plugin. If you take a look at the living demo page you will realize how it adds the active class by default to the active slide. Just check it with firebug or Chrome inspector.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top