You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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");
});
Any help would be greatly appreciated.
Cheers
Dan
The text was updated successfully, but these errors were encountered:
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");
});
Any help would be greatly appreciated.
Cheers
Dan
The text was updated successfully, but these errors were encountered: