1jQuery.noConflict(); 2 3(function($) 4{ 5 6 "use strict"; 7 8 $.fn.aetherNavigation = function(){ 9 10 var navigationButton = jQuery('.nav-button'), 11 navigation = jQuery('.navigation'), 12 navigationHeight = jQuery('.logo').height(), 13 windowWidth = jQuery(window).width(); 14 15 jQuery('#main-content section:first-child').css({ 16 "margin-top" : navigationHeight + 30 + "px" 17 }); 18 19 var sections = jQuery(jQuery('nav a[href="#footer"]').length > 0 ? 'section, footer' : 'section'); 20 var navigation_links = jQuery('nav a'); 21 sections.waypoint({ 22 handler: function(direction) { 23 var pos = jQuery.inArray(this,sections); 24 var active_section = sections.eq(direction === "up" ? Math.max(0,pos-1) : pos); 25 var active_link = jQuery('nav a[href$="#' + active_section.attr("id") + '"]'); 26 navigation_links.removeClass("active"); 27 active_link.addClass("active"); 28 }, 29 offset: '10%' 30 }); 31 32 if ( windowWidth > 960 ) { 33 navigation.addClass('desktop'); 34 navigation.removeClass('mobile'); 35 } 36 37 if ( windowWidth < 960 ) { 38 navigation.addClass('mobile'); 39 navigation.removeClass('desktop'); 40 } 41 42 navigationButton.click(function(){ 43 if(navigation.is(':hidden')) { 44 navigation.slideDown(); 45 } else { 46 navigation.slideUp(); 47 } 48 }); 49 50 jQuery('.navigation a').click(function(){ 51 if(navigation.is(':visible') && navigation.hasClass('mobile')) { 52 navigation.slideUp(); 53 } 54 }); 55 56 jQuery(window).resize(function() { 57 var ww = jQuery(window).width(), 58 nav = jQuery('.navigation'); 59 60 if ( ww > 960 ) { 61 nav.addClass('desktop'); 62 nav.removeClass('mobile'); 63 } 64 65 if ( ww < 960 ) { 66 nav.addClass('mobile'); 67 nav.removeClass('desktop'); 68 } 69 }); 70 }; 71 72})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.