-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'afterLoad' is not triggered when opening the page with anchor #251
Comments
Which index is your #contact section? |
Yeah, I was just editing the issue. I am using animateAnchor: false. Contact — 4th section. |
Solved. Thanks for reporting it. |
Tested on 1.7.4 just now. Nope :( |
Are you sure the js is not being cached? It works for me. |
By the way, if #contact is your 4th section you should use |
No cache (expires: -1 / nginx). $(function () {
'use strict';
var menu = $('#menu');
$.fn.fullpage({
anchors: ['hello', 'about', 'work', 'contact', 'goodbye'],
menu: '#menu',
verticalCentered: false,
easing: false,
resize: false,
css3: true,
animateAnchor: false,
slidesNavigation: true,
afterLoad: function (anchorLink, index) {
switch (index) {
case 1:
case 3:
case 5:
menu.addClass('bright').removeClass('dark');
break;
case 2:
case 4:
menu.addClass('dark').removeClass('bright');
break;
}
}
});
}); |
Sorry but I can not reproduce your problem. I have used your initialization and the class You might be doing something wrong somewhere else. |
Terribly sorry, my bad. The class is applied so the 'afterLoad' is called. |
You are probably forgetting something. Read the documentation about how to use the menu and the use of That's not a bug with the plugin. |
I am using it like this. <ul id="menu" class="bright">
<li data-menuanchor="hello" class="active">
<a href="#hello" class="icon-hello">
<span>Hello</span>
</a>
</li>
<li data-menuanchor="about">
<a href="#about" class="icon-about">
<span>About</span>
</a>
</li>
<li data-menuanchor="work">
<a href="#work" class="icon-work">
<span>Work</span>
</a>
</li>
<li data-menuanchor="contact">
<a href="#contact" class="icon-contact">
<span>Contact</span>
</a>
</li>
<li data-menuanchor="goodbye">
<a href="#goodbye" class="icon-goodbye">
<span>Thank you</span>
</a>
</li>
</ul> |
As you can see in the living examples, it works well. Sorry but I can not help you more with it. It is correct. |
Yep, not worries. If I find out what's wrong, I'll post here. Thanks anyway. |
In my code I change the 'menu' class after the section load, like this:
But, when I first visit the page using anchor (e.g.: /#contact), the menu class is not changed, because 'afterLoad' is not triggered at this point.
Am I doing it wrong or is it a bug?
The text was updated successfully, but these errors were encountered: