1// Function for parent nav menu links on mobile, preventing automatic redirection: first click opens sub menu, second click redirects to URL as normal. 2 3function isTouchDevice(){ 4 return typeof window.ontouchstart !== 'undefined'; 5} 6 7// jQuery(document).ready(function(){ 8// /* If mobile browser, prevent click on parent nav item from redirecting to URL */ 9// if(isTouchDevice()) { 10// // 1st click, add "clicked" class, preventing the location change. 2nd click will go through. 11// jQuery(".nav__sub-menu > li > a").click(function(event) { 12// // Perform a reset - Remove the "clicked" class on all other menu items 13// jQuery(".nav__sub-menu > li > a").not(this).removeClass("clicked"); 14// jQuery(this).toggleClass("clicked"); 15// if (jQuery(this).hasClass("clicked")) { 16// event.preventDefault(); 17// // return false; 18// } 19// }); 20// } 21// }); 22 23jQuery(document).ready(function(){ 24 /* If screen below 980px (mobile breakpoint) OR mobile browser, prevent click on parent nav item from redirecting to URL */ 25 if ( (jQuery(window).width() < 980) || isTouchDevice() ) { 26 // 1st click, add "clicked" class, preventing the location change. 2nd click will go through // 27 jQuery(".nav__sub-menu > li > a").click(function(event) { 28 // Perform a reset - Remove the "clicked" class on all other menu items // 29 jQuery(".nav__sub-menu > li > a").not(this).removeClass("clicked"); 30 jQuery(this).toggleClass("clicked"); 31 if (jQuery(this).hasClass("clicked")) { 32 // event.preventDefault(); 33 return false; 34 } 35 }); 36 } 37});
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.