1// Menu Toggler 2$('#menu-toggle').click(function () { 3 $(this).toggleClass('open'); 4 $('.main-nav').toggleClass('open'); 5 $('.header-bottom').toggleClass('open'); 6 $('.overylay-zoom').toggleClass('show'); 7 $('body').toggleClass('overflow-hidden'); 8}); 9// Search Toggler 10$('.btn-search-toggler').click(function () { 11 $('.search-wrapper').addClass('open'); 12 setTimeout(function () { 13 $('.search-field').focus(); 14 }, 400); 15}); 16 17$('.btn-txt-clear').click(function () { 18 $('.search-wrapper').removeClass('open'); 19 // clear search field on box close 20 if ($('.search-field').val() != "") { 21 $('.search-field').val(''); 22 } 23}); 24// for the search 25$(".search-mobile").click(function(){ 26 $('.search').addClass('expand'); 27 $('.close').addClass('expand'); 28 }); 29 30 $(".close").click(function(){ 31 $('.search').removeClass('expand'); 32 $(this).removeClass('expand'); 33 }); 34 35$(window).load(function () { 36 // Active Hover transision move 37 var activeMenu = $('.main-nav').find('li.active'), 38 activeWidth = activeMenu.width(), 39 activePos = activeMenu.position(); 40 $('.active-hover').css({ 41 width: activeWidth - 30, 42 left: activePos.left + 15, 43 display: 'block' 44 }); 45 $('.main-nav>li').mouseenter(function () { 46 var newHoverPos = $(this).position(), 47 newHoverWidth = $(this).width(); 48 $('.active-hover').css({ 49 width: newHoverWidth - 30, 50 left: newHoverPos.left + 15 51 }); 52 }); 53 $('.main-nav>li').mouseleave(function () { 54 $('.active-hover').css({ 55 width: activeWidth - 30, 56 left: activePos.left + 15 57 }); 58 }); 59 /*$('.main-nav li.has-child>a').attr('href','javascript:void(0)');*/ 60 61 // Default tab collapse 62 $('.tab-default').tabCollapse(); 63}); 64 65$(document).ready(function () { 66 // add class if tab length is 1 67 var noTabs = $('.tab-default'); 68 $(noTabs).each(function (e, v) { 69 if ($(v).children().length < 2) { 70 $(this).addClass('single-tab'); 71 } 72 }); 73}); 74 75// convert img url to svg if it has svg class 76$(document).ready(function () { 77 function svg() { 78 /* 79 * Replace all SVG images with inline SVG 80 */ 81 $('img.svg').each(function () { 82 var $img = $(this); 83 var imgID = $img.attr('id'); 84 var imgClass = $img.attr('class'); 85 var imgURL = $img.attr('src'); 86 87 $.get(imgURL, function (data) { 88 // Get the SVG tag, ignore the rest 89 var $svg = $(data).find('svg'); 90 91 // Add replaced image's ID to the new SVG 92 if (typeof imgID !== 'undefined') { 93 $svg = $svg.attr('id', imgID); 94 } 95 // Add replaced image's classes to the new SVG 96 if (typeof imgClass !== 'undefined') { 97 $svg = $svg.attr('class', imgClass + ' replaced-svg'); 98 } 99 100 // Remove any invalid XML tags as per http://validator.w3.org 101 $svg = $svg.removeAttr('xmlns:a'); 102 103 // Replace image with new SVG 104 $img.replaceWith($svg); 105 106 }, 'xml'); 107 108 }); 109 } 110 svg(); 111});
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.