1 jQuery(document).ready(function() { 2 "use strict"; 3// Dropdown menu 4 function thDropdownMenu() { 5 var wWidth = jQuery(window).width(); 6 if (wWidth > 1024) { 7 jQuery('.navigation ul.sub-menu, .navigation ul.children').hide(); 8 var timer; 9 var delay = 100; 10 jQuery('.navigation li').hover( 11 function() { 12 var $this = jQuery(this); 13 timer = setTimeout(function() { 14 $this.children('ul.sub-menu, ul.children').slideDown('fast'); 15 }, delay); 16 17 }, 18 function() { 19 jQuery(this).children('ul.sub-menu, ul.children').hide(); 20 clearTimeout(timer); 21 } 22 ); 23 //keynavigation 24 jQuery(".menu-item a").focusin(function(){ 25 jQuery(this).parent().prev().find('.sub-menu').css("display","none"); 26 jQuery('+ .sub-menu', this).css("display","block"); 27 }); 28 } else { 29 jQuery('.navigation li').removeClass('active'); 30 jQuery('.navigation li.active > ul.sub-menu, .navigation li.active > ul.children').show(); 31 } 32 } 33 34 thDropdownMenu(); 35 36 jQuery(window).resize(function() { 37 thDropdownMenu(); 38 }); 39 40 //Vertical menus toggles 41 42 jQuery('.widget .menu-menu-1-container, .navigation .menu').addClass('toggle-menu'); 43 jQuery('.toggle-menu ul.sub-menu, .toggle-menu ul.children').addClass('toggle-submenu'); 44 jQuery('.toggle-menu ul.sub-menu').parent().addClass('toggle-menu-item-parent'); 45 46 jQuery('.toggle-menu .toggle-menu-item-parent').prepend('<span class="toggle-caret" tabindex="0"><i class="fa fa-plus"></i></span>'); 47 48 jQuery('.toggle-caret').click(function(e) { 49 e.preventDefault(); 50 jQuery(this).parent().toggleClass('active').children('.toggle-submenu').slideToggle('fast'); 51 }); 52 53 jQuery('.toggle-caret').keypress(function(e) { 54 e.preventDefault(); 55 jQuery(this).parent().toggleClass('active').children('.toggle-submenu').slideToggle('fast'); 56 }); 57// Esc key close menu 58 document.addEventListener( 'keydown', function( event ) { 59 if ( event.keyCode === 27 ) { 60 event.preventDefault(); 61 document.querySelectorAll( '.mobile-menu-active' ).forEach( function( element ) { 62 jQuery('body').removeClass('mobile-menu-active'); 63 }.bind( this ) ); 64 document.querySelectorAll( '.mobile-above-menu-active' ).forEach( function( element ) { 65 jQuery('body').removeClass('mobile-above-menu-active'); 66 }.bind( this ) ); 67 document.querySelectorAll( '.mobile-bottom-menu-active' ).forEach( function( element ) { 68 jQuery('body').removeClass('mobile-bottom-menu-active'); 69 }.bind( this ) ); 70 } 71 }.bind( this ) ); 72 73 //keynavigation close on last item 74jQuery(".navigation .menu>.menu-item:nth-last-child(1) a").focusout(function(){ 75 jQuery('body').removeClass('mobile-menu-active'); 76 }); 77 // Show-hide Scroll to top & move-to-top arrow 78
79 jQuery("body").prepend("<a id='move-to-top' class='animate ' href='#header'><i class=''></i></a>"); 80 81 var scrollDes = 'html,body'; 82 /*Opera does a strange thing if we use 'html' and 'body' together so my solution is to do the UA sniffing thing*/ 83 if (navigator.userAgent.match(/opera/i)) { 84 scrollDes = 'html'; 85 } 86 //show ,hide 87 jQuery(window).scroll(function() { 88 if (jQuery(this).scrollTop() > 120) { 89 jQuery('#move-to-top').addClass('filling').removeClass('hiding'); 90 } else { 91 jQuery('#move-to-top').removeClass('filling').addClass('hiding'); 92 } 93 }); 94 //smooth scrolling to navigation active 95if(jQuery(".home").length) { 96 jQuery('.navigation ul li a:first').addClass('active'); 97 98 var sections = jQuery('section,.wrap'), 99 // wrap = jQuery('.wrap'), 100 nav = jQuery('nav'), 101 nav_height = nav.outerHeight(); 102 103 jQuery(window).on('scroll', function () { 104 var cur_pos = jQuery(this).scrollTop(); 105 106 sections.each(function() { 107 var top = jQuery(this).offset().top-150, 108 bottom = top + jQuery(this).outerHeight(); 109 110 if (cur_pos >= top && cur_pos <= bottom) { 111 nav.find('a').removeClass('active'); 112 sections.removeClass('active'); 113 114 jQuery(this).addClass('active'); 115 nav.find('a[href="#'+jQuery(this).attr('id')+'"]').addClass('active'); 116 } 117 }); 118 }); 119 120 nav.find('a').on('click', function () { 121 if(jQuery('.mobile-menu-active').length){ 122 jQuery('body').removeClass('mobile-menu-active'); 123 } 124 var $el = jQuery(this) 125 , id = $el.attr('href'); 126 127 jQuery('html, body').animate({ 128 scrollTop: jQuery(id).offset().top 129 }, 500); 130 131 return false; 132 }); 133} 134//*****************/ 135// hero id scroll 136//*****************/ 137if(jQuery(".hero-scroll").length) { 138 jQuery(".hero-scroll a[href^='#']").click(function(e) { 139 e.preventDefault(); 140 var position = jQuery( jQuery(this).attr("href")).offset().top; 141 jQuery("body, html").animate({ 142 scrollTop: position 143 } /* speed */ ); 144}); 145} 146 147 // Responsive Navigation 148 149 // Responsive Navigation 150 151 /* <![CDATA[ */ 152 var themehunk_customscript = { 153 "responsive": "1", 154 "nav_menu": "secondary" 155 }; 156 /* ]]> */ 157 if (themehunk_customscript.responsive && themehunk_customscript.nav_menu != 'none') { 158 jQuery(document).ready(function($) { 159 // merge if two menus exist 160 if (themehunk_customscript.nav_menu == 'both') { 161 jQuery('.navigation').not('.mobile-menu-wrapper').find('.menu').clone().appendTo('.mobile-menu-wrapper').hide(); 162 } 163 164 jQuery('.toggle-mobile-menu').click(function(e) { 165 e.preventDefault(); 166 e.stopPropagation(); 167 jQuery('body').toggleClass('mobile-menu-active'); 168 }); 169 170 // prevent propagation of scroll event to parent 171 jQuery(document).on('DOMMouseScroll mousewheel', '.mobile-menu-wrapper', function(ev) { 172 var $this = jQuery(this), 173 scrollTop = this.scrollTop, 174 scrollHeight = this.scrollHeight, 175 height = $this.height(), 176 delta = (ev.type == 'DOMMouseScroll' ? 177 ev.originalEvent.detail * -40 : 178 ev.originalEvent.wheelDelta), 179 up = delta > 0; 180 181 var prevent = function() { 182 ev.stopPropagation(); 183 ev.preventDefault(); 184 ev.returnValue = false; 185 return false; 186 } 187 188 if (jQuery('a#pull').css('display') !== 'none') { // if toggle menu button is visible ( small screens ) 189 190 if (!up && -delta > scrollHeight - height - scrollTop) { 191 // Scrolling down, but this will take us past the bottom. 192 $this.scrollTop(scrollHeight); 193 return prevent(); 194 } else if (up && delta > scrollTop) { 195 // Scrolling up, but this will take us past the top. 196 $this.scrollTop(0); 197 return prevent(); 198 } 199 } 200 }); 201 }).on('click', function(event) { 202 203 var $target = jQuery(event.target); 204 if (($target.hasClass("fa") && $target.parent().hasClass("toggle-caret")) || $target.hasClass("toggle-caret")) { // allow clicking on menu toggles 205 return; 206 } 207 208 jQuery('body').removeClass('mobile-menu-active'); 209 }); 210 } 211// Scroll down header
212 function init() { 213 window.addEventListener('scroll', function(e){ 214 var distanceY = window.pageYOffset || document.documentElement.scrollTop, 215 shrinkOn = 250, 216 header = document.querySelector("header"); 217 if (distanceY > shrinkOn) { 218 classie.add(header,"smaller"); 219 220 } else { 221 if (classie.has(header,"smaller")) { 222 classie.remove(header,"smaller"); 223 224 } 225 } 226 }); 227 } 228 229/*scroll header function*/ 230 jQuery(window).scroll(function() { 231 var scroll =jQuery(window).scrollTop(); 232 233 if (scroll >=100) { 234 jQuery(".header").addClass('smaller'); 235 } else { 236 jQuery(".header").removeClass("smaller"); 237 } 238 }); 239 240 241 242 }); 243 /* start flex slider*/ 244 jQuery(window).load(function() { 245 var newspeed = jQuery("#txt_slidespeed").val(); 246 jQuery('.flexslider').flexslider({ 247 slideshowSpeed: newspeed, 248 slide_easing: 'easeInOutCubic', 249 animationSpeed: 1000, 250 pauseOnHover: true, 251 }); 252}); 253 /* end flex slider*/ 254 255 /*end scroll header function*/ 256 /*testimonials slider*/ 257 jQuery(window).load(function(){ 258 jQuery('.bxslider').bxSlider({ 259 mode:'fade', 260 auto: true, 261 autoControls: true, 262 adaptiveHeight: false, 263 }); 264 265// animation-wow 266 267 wow = new WOW( 268 { 269 animateClass: 'animated', 270 offset: 100, 271 callback: function(box) { 272 // console.log("WOW: animating <" + box.tagName.toLowerCase() + ">") 273 } 274 } 275 ); 276 wow.init(); 277 278 // loader 279jQuery(".loader").fadeOut("slow"); 280 jQuery(".overlayloader").delay(1000).fadeOut("slow"); 281 282}); 283 284 285///start pallaxx 286 jQuery(function(){ 287 if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { 288 (function(n){n.viewportSize={},n.viewportSize.getHeight=function(){return t("Height")},n.viewportSize.getWidth=function(){return t("Width")};var t=function(t){var f,o=t.toLowerCase(),e=n.document,i=e.documentElement,r,u;return n["inner"+t]===undefined?f=i["client"+t]:n["inner"+t]!=i["client"+t]?(r=e.createElement("body"),r.id="vpw-test-b",r.style.cssText="overflow:scroll",u=e.createElement("div"),u.id="vpw-test-d",u.style.cssText="position:absolute;top:-1000px",u.innerHTML="<style>@media("+o+":"+i["client"+t]+"px){body#vpw-test-b div#vpw-test-d{"+o+":7px!important}}<\/style>",r.appendChild(u),i.insertBefore(r,e.head),f=u["offset"+t]==7?i["client"+t]:n["inner"+t],i.removeChild(r)):f=n["inner"+t],f}})(this); 289 290 291( function( $ ) { 292 293 // Setup variables 294 $window = $(window); 295 $body = $('body'); 296 297 //FadeIn all sections 298 299 function adjustWindow(){ 300 301 // Init Skrollr 302 var s = skrollr.init({ 303 render: function(data) { 304 305 //Debugging - Log the current scroll position. 306 //console.log(data.curTop); 307 } 308 }); 309 310 // Get window size 311 winH = $window.height(); 312 313 // Keep minimum height 550 314 if(winH <= 550) { 315 winH = 550; 316 } 317 318 319 } 320 321} )( jQuery ); 322} 323 else { 324 (function(n){n.viewportSize={},n.viewportSize.getHeight=function(){return t("Height")},n.viewportSize.getWidth=function(){return t("Width")};var t=function(t){var f,o=t.toLowerCase(),e=n.document,i=e.documentElement,r,u;return n["inner"+t]===undefined?f=i["client"+t]:n["inner"+t]!=i["client"+t]?(r=e.createElement("body"),r.id="vpw-test-b",r.style.cssText="overflow:scroll",u=e.createElement("div"),u.id="vpw-test-d",u.style.cssText="position:absolute;top:-1000px",u.innerHTML="<style>@media("+o+":"+i["client"+t]+"px){body#vpw-test-b div#vpw-test-d{"+o+":7px!important}}<\/style>",r.appendChild(u),i.insertBefore(r,e.head),f=u["offset"+t]==7?i["client"+t]:n["inner"+t],i.removeChild(r)):f=n["inner"+t],f}})(this); 325 326 327( function() { 328 329 // Setup variables 330 $window = jQuery(window); 331 $body = jQuery('body'); 332 333 //FadeIn all sections 334 $body.imagesLoaded( function() { 335 setTimeout(function() { 336 337 // Resize sections 338 adjustWindow(); 339 340 // Fade in sections 341 $body.removeClass('loading').addClass('loaded'); 342 343 }, 800); 344 }); 345 346 function adjustWindow(){ 347 348 // Init Skrollr 349 var s = skrollr.init({ 350 render: function(data) { 351 352 //Debugging - Log the current scroll position. 353 //console.log(data.curTop); 354 } 355 }); 356 357 // Get window size 358 winH = $window.height(); 359 360 // Keep minimum height 550 361 if(winH <= 550) { 362 winH = 550; 363 } 364 365 366 } 367 368} )( jQuery ); 369 } 370}); 371 372//move to top 373if (jQuery("#scroll").length) { 374jQuery(document).ready(function(){ 375 jQuery(window).scroll(function(){ 376 if (jQuery(this).scrollTop() > 100) { 377 jQuery('#scroll').fadeIn(); 378 } else { 379 jQuery('#scroll').fadeOut(); 380 } 381 }); 382 jQuery('#scroll').click(function(){ 383 jQuery("html, body").animate({ scrollTop: 0 }, 600); 384 return false; 385 }); 386}); 387}
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.