1var mq = matchMedia("(min-width: 750px)"); 2 3$(document).ready(function () { 4 if (window.mq.matches) { 5 $("#mainnav ul > li").mouseenter(function () { 6 //mouse enter 7 var menu = $(this).find("ul:first"); 8 menu.fadeIn('fast'); 9 }).mouseleave(function () { 10 //mouse leave 11 var menu = $(this).find("ul:first"); 12 menu.fadeOut('fast'); 13 }); 14 } else { 15 $(".menu").click(function () { 16 $("body").toggleClass("slideNav"); 17 }); 18 19 //open the parent 20 $("#navContainer li.on").addClass('open').children('ul').css("display", "block"); 21 22 $("#navContainer li>span").click(function () { 23 if ($(this).parent().hasClass("open")) { 24 $(this).prev().css("display", "block").slideUp("400"); 25 } else { 26 $(this).prev().slideDown("400"); 27 } 28 $(this).parent().toggleClass("open"); 29 }); 30 $(window).scroll(function () { 31 if ($(window).scrollTop() > 200) { 32 $('.hamburger').addClass('on'); 33 } 34 if ($(window).scrollTop() < 200) { 35 $('.hamburger').removeClass('on'); 36 } 37 }) 38 39 } 40 mq.addListener(function () { 41 location.reload(); 42 }); 43 44 // see whether device supports touch events (a bit simplistic, but...) 45 var hasTouch = ("ontouchstart" in window); 46 var iOS5 = /iPad|iPod|iPhone/.test(navigator.platform) && "matchMedia" in
46window; 47 48 // hook touch events for drop-down menus 49 // NB: if has touch events, then has standards event handling too 50 // but we don't want to run this code on iOS5+ 51 if (hasTouch && document.querySelectorAll && !iOS5) { 52 var i, len, element, 53 dropdowns = document.querySelectorAll("#mainnav ul li > a"); 54 55 56 function menuTouch(event) { 57 // toggle flag for preventing click for this link 58 var i, len, noclick = !(this.dataNoclick); 59 60 // reset flag on all links 61 for (i = 0, len = dropdowns.length; i < len; ++i) { 62 dropdowns[i].dataNoclick = false; 63 } 64 65 // set new flag value and focus on dropdown menu 66 this.dataNoclick = noclick; 67 this.focus(); 68 } 69 70 function menuClick(event) { 71 // if click isn't wanted, prevent it 72 if (this.dataNoclick) { 73 event.preventDefault(); 74 } 75 } 76 77 for (i = 0, len = dropdowns.length; i < len; ++i) { 78 element = dropdowns[i]; 79 element.dataNoclick = false; 80 element.addEventListener("touchstart", menuTouch, false); 81 element.addEventListener("click", menuClick, false); 82 } 83 } 84}); 85 86$(window).scroll(function () { 87 if ($(window).scrollTop() > 70) { 88 $('body').addClass('stick'); 89 } 90 if ($(window).scrollTop() < 70) { 91 $('body').removeClass('stick'); 92 } 93}) 94 95$(function () { 96 var $gallery = $('.gallery a').simpleLightbox(); 97});
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.