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
I am trying to get the lavalamp effect to update as the page scrolls into different sections. I have the 'active' class changing on each li element as the page scrolls using the code below. But for some reason the lavalamp plugin isn't updating it's position.
var sections = $('.menu-update'),
links = $('#menu-main li');
$(window).scroll(function() {
var currentPosition = $(this).scrollTop();
sections.each(function() {
var top = $(this).offset().top,
bottom = top + $(this).height();
if (currentPosition >= top && currentPosition <= bottom) {
links.removeClass('active');
$('a[href="#' + this.id + '"]').parent().addClass('active');
}
});
});
Is there a way to force lavalamp to update? Maybe something like
$('#menu-main').lavalamp('update');
Thanks!
The text was updated successfully, but these errors were encountered:
The plugin only looks for the active class when it is first initiated. Updated in 1.0.4, You can now manually send the active element to the wrapper data.
Hi,
I am trying to get the lavalamp effect to update as the page scrolls into different sections. I have the 'active' class changing on each li element as the page scrolls using the code below. But for some reason the lavalamp plugin isn't updating it's position.
Is there a way to force lavalamp to update? Maybe something like
Thanks!
The text was updated successfully, but these errors were encountered: