1(function($) { 2 3 "use strict"; 4 5 // Cache selectors 6 var lastId, 7 topMenu = $(".menu-holder"), 8 topMenuHeight = 45, 9 // All list items 10 menuItems = topMenu.find("a"), 11 // Anchors corresponding to menu items 12 scrollItems = menuItems.map(function(){ 13 var item = $($(this).attr("href")); 14 15 if (item.length) { 16 return item; 17 } 18 }); 19 20 if($(window).width()<=767){ 21 topMenuHeight = 0; 22 } 23 24 // Bind click handler to menu items 25 // so we can get a fancy scroll animation 26 menuItems.click(function(e){ 27 var href = $(this).attr("href"); 28 var offsetTop = href === "#" ? 0 : $(href).offset().top - topMenuHeight + 1; 29 30 $('html, body').stop().animate({ 31 scrollTop: offsetTop 32 }, 300); 33 34 e.preventDefault(); 35 }); 36 37 // Bind to scroll 38 $(window).scroll(function(){ 39 // Get container scroll position 40 var fromTop = $(this).scrollTop()+topMenuHeight; 41 42 // Get id of current scroll item 43 var cur = scrollItems.map(function(){ 44 if ($(this).offset().top < fromTop) 45 return this; 46 }); 47 48 // Get the id of the current element 49 cur = cur[cur.length-1]; 50 var id = cur && cur.length ? cur[0].id : ""; 51 52 if (lastId !== id && id != "") { 53 lastId = id; 54 // Set/remove active class 55 menuItems 56 .parent().removeClass("active") 57 .end().filter("[href=#"+id+"]").parent().addClass("active"); 58 } 59 60 /* Change navigation header on scroll 61 -------------------------------------- */ 62 if($(window).width() > 767) { 63 if ($(this).scrollTop() > 100){ 64 $('.templatemo-nav-container').addClass("sticky"); 65 } 66 else { 67 $('.templatemo-nav-container').removeClass("sticky"); 68 } 69 } else { 70 $('.templatemo-nav-container').removeClass("sticky"); 71 } 72 }); 73 74 //mobile menu and desktop menu 75 $("#responsive-menu").css({"right":-1500}); 76 $("#mobile_menu").click(function(){ 77 $("#responsive-menu").show(); 78 $("#responsive-menu").animate({ "right":0 }); 79 return false; 80 }); 81 $(window).on("load resize", function(){ 82 if($(window).width()>767){ 83 $("#responsive-menu").css({"right":-1500}); 84 85 if ($(window).scrollTop() > 100){ 86 $('.templatemo-nav-container').addClass("sticky"); 87 } 88 else { 89 $('.templatemo-nav-container').removeClass("sticky"); 90 } 91 } 92 else { 93 $('.templatemo-nav-container').removeClass("sticky"); 94 } 95 }); 96 97 $("#responsive-menu a").click(function(){ 98 $("#responsive-menu").hide(); 99 }); 100 101})(jQuery); 102 103 104 105/* HTML document is loaded 106----------------------------------*/ 107$(document).ready(function(){ 108 109 if($(window).width() > 767) { 110 if ($(window).scrollTop() > 100){ 111 $('.templatemo-nav-container').addClass("sticky"); 112 } 113 else { 114 $('.templatemo-nav-container').removeClass("sticky"); 115 } 116 } 117 118 /* Map */ 119 // Make sure map's height is the same as form height in all browsers 120 $('#map-canvas').height($('.tm-contact-form').height()); 121}); 122 123/* HTML page is fully loaded, including images, frames 124-----------------------------------------------------------*/ 125$(window).load(function() { 126 $('.flexslider').flexslider({ 127 animation: "slide", 128 slideshow: false, 129 directionNav: false 130 }); 131});
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.