Skip to content
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

Question #20

Open
danielnr87 opened this issue Sep 16, 2015 · 0 comments
Open

Question #20

danielnr87 opened this issue Sep 16, 2015 · 0 comments

Comments

@danielnr87
Copy link

Hi,
Thanks for the plugin, I'm using it to track changes of a class on menu items (.active), which are fired by Foundation's Magellan plugin http://foundation.zurb.com/docs/components/magellan.html

For some reason it isnt listening to the first li item's changes. I think it has something to do with the fact it seems to add 'class' to the non active ones on mouse move, and 'class="active"' on the one which is in view. I think this has something to do with it because the elements are still being changed.

This is my code (it also changes some values on a counter).

$('#menu-2005').attrchange({
callback: function (event) {
$(".number1").html('0');
$(".number2").html('0');
$(".number3").html('2');
$('.staff-counter').css("left", "0");
}
});
$('#menu-2006').attrchange({
callback: function (event) {
$(".number1").html('0');
$(".number2").html('0');
$(".number3").html('4');
var counterMenuPosition = $(this).position();
$('.staff-counter').css("left", counterMenuPosition.left);
}
});

Is there anyway I can just listen to see if a specific class has been applied to a specific li? Ideally something like
if ($('#menu-2005').hasClass('active')) {
$(".number1").html('0');
$(".number2").html('0');
$(".number3").html('2');
$('.staff-counter').css("left", "0");
});
screen shot 2015-09-16 at 22 56 26

Any help would be greatly appreciated.
Cheers
Dan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant