“All About Savary Island” ul’).slideToggle(); }); // show/hide submenu $(‘#mobile_navigation .mobile_subnav’).on(‘click’, function() { $(this).toggleClass(‘expanded’).closest(‘li’).find(‘> .sub_navigation’).slideToggle(); return false; }); // when a navigation item is also a link add a secondary item $(‘#mobile_navigation .mobile_subnav’).each(function(i, item) { var $item = $(item); if ($item.attr(‘href’).match(/^#|javascript/)) return; $item.closest(‘li’).find(‘> ul’).prepend($(‘

  • ‘).append($item.clone().removeClass(‘mobile_subnav’).addClass(‘mobile_subnav_link’))); }); //add active to the navigation, this is so we dont have to clear the cache each time $(‘#mobile_navigation ul li a’).each(function(){ if($(this).attr(‘href’) == window.location.pathname){ $(this).parent().addClass(‘active’); return false; } }); })($j); ]]>
  • Source

    Leave a Comment

    Your email address will not be published. Required fields are marked *