1function FixInternalNav(element, fixmeTop){ 2 // Assign scroll event listener 3 var currentScroll = $(window).scrollTop(); // Get current position 4 if (currentScroll >= fixmeTop) { // Make it fixed if you've scrolled to it 5 element.css({ 6 position: 'fixed', 7 top: '0', 8 }); 9 } else { // Make it static if you scroll above 10 element.css({ 11 position: 'relative' 12 }); 13 } 14} 15 16$(document).ready(function(e) { 17 //This should start the slider on the homepage 18 // If it doesn't work check the flexslider demo site, or look at the JS file, or just contact Eric 19 if($(".flexslider").length){ 20 $(".flexslider").flexslider({ 21 useCSS : false, 22 slideshow:true, 23 animation: "slide", 24 animationLoop: true, 25 smoothHeight: true, 26 slideshowSpeed:12000, 27 animationSpeed : 1000, 28 mousewheel: false, 29 controlNav: true, 30 directionNav: false, 31 start: function(slider){ 32 $('.flexslider').resize(); 33 } 34 }); 35 }; 36 37 //This is applied fixed positioning to a nav div, but only on the Menu Page 38 if ($("#floatingNav").length>500){ 39 var InitialOffset = $('#floatingNav').offset().top; 40 $(window).scroll(function(){ 41 FixInternalNav($('#floatingNav'),InitialOffset) 42 }); 43 FixInternalNav($('#floatingNav'),InitialOffset); 44 } 45 46 47 48 //This makes links SCROLL instead if jumping 49// $(function() { 50// $('a[href*=#]:not([href=#])').click(function() { 51// if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 52// var target = $(this.hash); 53// target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 54// if (target.length) { 55 // $('html,body').animate({scrollTop: target.offset().top}, 500); 56// return false; 57// } 58// } 59 // }); 60// }); 61 62//Firefox gets cranky about linking to anchor tags from an external source, this fixes that by checking the hash in the URL and manually scrolling to it when you load the page 63 var anchor_id = window.location.hash.replace(/([ #;?%&,.+*~\':"!^$[\]()=>|\/@])/g,'\\$1'); 64 if (anchor_id != "") { 65 var new_position = $(anchor_id).offset(); 66 if(new_position){ 67 window.scrollTo(new_position.left,new_position.top); 68 } 69 70 } 71 72 73}); 74 75 76 77$(".MenuContentContainer").ready(function() { 78 //console.log($(window).scrollTop()) 79 if ($(window).scrollTop() > 0) { 80 $('#floatingNav').addClass('navbar-fixed'); 81 $('.MenuContentContainer').addClass('SetTopMargin'); 82 } 83 if ($(window).scrollTop() < 1) { 84 $('#floatingNav').removeClass('navbar-fixed'); 85 $('.MenuContentContainer').removeClass('SetTopMargin'); 86 } 87 $(window).scroll(function () { 88 //console.log($(window).scrollTop()) 89 if ($(window).scrollTop() > 0) { 90 $('#floatingNav').addClass('navbar-fixed'); 91 $('.MenuContentContainer').addClass('SetTopMargin'); 92 } 93 if ($(window).scrollTop() < 1) { 94 $('#floatingNav').removeClass('navbar-fixed'); 95 $('.MenuContentContainer').removeClass('SetTopMargin'); 96 } 97 }); 98}); 99$(function() { 100 $('a[href*=#]:not([href=#])').click(function() { 101 if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 102 var target = $(this.hash); 103 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 104 if (target.length) { 105 $('html,body').animate({scrollTop: target.offset().top-130}, 500); 106 return false; 107 } 108 } 109 }); 110});
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.