Script not working
-
My code is not working if the user is not logged in
jQuery(document).ready(function( $ ){ // Navigation Scroll $(window).scroll(function(event) { Scroll(); }); $('.nav-horizontal ul li a').on('click', function() { $('html, body').animate({scrollTop: $(this.hash).offset().top - 40}, 1000); return false; }); }); function Scroll() { var contentTop = []; var contentBottom = []; var winTop = jQuery(window).scrollTop(); var rangeTop = 200; var rangeBottom = 500; jQuery('.menu').find('.menu-item a').each(function(){ contentTop.push( jQuery( jQuery(this).attr('href') ).offset().top); contentBottom.push( jQuery( jQuery(this).attr('href') ).offset().top + jQuery( jQuery(this).attr('href') ).height() ); }) jQuery.each( contentTop, function(i){ if ( winTop > contentTop[i] - rangeTop ){ jQuery('.menu li.menu-item') .removeClass('menu-active') .eq(i).addClass('menu-active'); } }) }The page I need help with: [log in to see the link]
The topic ‘Script not working’ is closed to new replies.