1(function($) { 2 3 "use strict"; 4 5 //Preloader 6 function handlePreloader() { 7 if($('.preloader').length){ 8 $('.preloader').delay(100).fadeOut(500); 9 } 10 } 11 12 13 14 //Update Header Style + Scroll to Top 15 function headerStyle() { 16 if($('.main-header').length){ 17 var windowpos = $(window).scrollTop(); 18 if (windowpos >= 200) { 19 $('.main-header').addClass('fixed-header'); 20 $('.scroll-to-top').fadeIn(300); 21 } else { 22 $('.main-header').removeClass('fixed-header'); 23 $('.scroll-to-top').fadeOut(300); 24 } 25 } 26 } 27 28 headerStyle(); 29 30 31 //Language Dropdown Hide / Show 32 if($('.lang-box .lang-list').length){ 33 $('.lang-box .sel-btn').on('click', function() { 34 $('.lang-box .lang-list').fadeToggle(300); 35 }); 36 } 37 38 39 //Hidden Bar Menu Config 40 function hiddenBarMenuConfig() { 41 var menuWrap = $('.hidden-bar .side-menu'); 42 // appending expander button 43 menuWrap.find('.dropdown').children('a').append(function () { 44 return '<button type="button" class="btn expander"><i class="icon fa fa-bars"></i></button>'; 45 }); 46 // hidding submenu 47 menuWrap.find('.dropdown').children('ul').hide(); 48 // toggling child ul 49 menuWrap.find('.btn.expander').each(function () { 50 $(this).on('click', function () { 51 $(this).parent() // return parent of .btn.expander (a) 52 .parent() // return parent of a (li) 53 .children('ul').slideToggle(); 54 55 // adding class to expander container 56 $(this).parent().toggleClass('current'); 57 // toggling arrow of expander 58 $(this).find('i').toggleClass('fa-minus fa-bars'); 59 60 return false; 61 62 }); 63 }); 64 } 65 66 //Custom Scroll Bar for Hidden Sidebar 67 function customScrollBarHiddenSidebar() { 68 if ($('.hidden-bar-wrapper').length) { 69 $('.hidden-bar-wrapper').mCustomScrollbar(); 70 } 71 } 72 73 //Hidden Bar Toggler 74 function hiddenBarToggler() { 75 if ($('.hidden-bar-closer').length) { 76 $('.hidden-bar-closer').on('click', function () { 77 $('.hidden-bar').removeClass('visible-sidebar'); 78 }); 79 } 80 if ($('.hidden-bar-opener').length) { 81 $('.hidden-bar-opener').on('click', function () { 82 $('.hidden-bar').addClass('visible-sidebar'); 83 }); 84 } 85 } 86 87 88 //Revolution Slider 89 if($('.revolution-slider .tp-banner').length){ 90 91 jQuery('.revolution-slider .tp-banner').show().revolution({ 92 delay:10000, 93 startwidth:1200, 94 startheight:720, 95 hideThumbs:600, 96 97 thumbWidth:80, 98 thumbHeight:50, 99 thumbAmount:5, 100 101 navigationType:0, 102 navigationArrows:"1", 103 navigationStyle:"preview3", 104 105 touchenabled:"on", 106 onHoverStop:"off", 107 108 swipe_velocity: 0.7, 109 swipe_min_touches: 1, 110 swipe_max_touches: 1, 111 drag_block_vertical: false, 112 113 parallax:"mouse", 114 parallaxBgFreeze:"on", 115 parallaxLevels:[7,4,3,2,5,4,3,2,1,0], 116 117 keyboardNavigation:"off", 118 119 navigationHAlign:"center", 120 navigationVAlign:"bottom", 121 navigationHOffset:0, 122 navigationVOffset:0, 123 124 soloArrowLeftHalign:"left", 125 soloArrowLeftValign:"center", 126 soloArrowLeftHOffset:0, 127 soloArrowLeftVOffset:0, 128 129 soloArrowRightHalign:"right", 130 soloArrowRightValign:"center", 131 soloArrowRightHOffset:0, 132 soloArrowRightVOffset:0, 133 134 shadow:0, 135 fullWidth:"on", 136 fullScreen:"on", 137 138 spinner:"spinner4", 139 140 stopLoop:"off", 141 stopAfterLoops:-1, 142 stopAtSlide:-1, 143 144 shuffle:"off", 145 146 autoHeight:"off", 147 forceFullWidth:"on", 148 149 hideThumbsOnMobile:"on", 150 hideNavDelayOnMobile:1500, 151 hideBulletsOnMobile:"on", 152 hideArrowsOnMobile:"on", 153 hideThumbsUnderResolution:0, 154 155 hideSliderAtLimit:0, 156 hideCaptionAtLimit:0, 157 hideAllCaptionAtLilmit:0, 158 startWithSlide:0, 159 videoJsPath:"", 160 fullScreenOffsetContainer: "" 161 }); 162 163 164 } 165 166 167 //LightBox / Fancybox 168 if($('.lightbox-image').length) { 169 $('.lightbox-image').fancybox({ 170 openEffect : 'elastic', 171 closeEffect : 'elastic', 172 helpers : { 173 media : {} 174 } 175 }); 176 } 177 178 179 //Sponsors Slider 180 if ($('.sponsors-slider').length) { 181 $('.sponsors-slider').owlCarousel({ 182 loop:true, 183 margin:0, 184 nav:true, 185 smartSpeed: 500, 186 autoplay: 4000, 187 navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], 188 responsive:{ 189 0:{ 190 items:1 191 }, 192 480:{ 193 items:2 194 }, 195 600:{ 196 items:3 197 }, 198 800:{ 199 items:4 200 }, 201 1200:{ 202 items:5 203 } 204 } 205 }); 206 } 207 208 209 //Single Item Carousel 210 if ($('.single-item-carousel').length) { 211 $('.single-item-carousel').owlCarousel({ 212 loop:true, 213 margin:0, 214 nav:true, 215 smartSpeed: 500, 216 autoplay: 5000, 217 navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], 218 responsive:{ 219 0:{ 220 items:1 221 }, 222 600:{ 223 items:1 224 }, 225 1024:{ 226 items:1 227 }, 228 1400:{
229 items:1 230 } 231 } 232 }); 233 } 234 235 //Accordion Box 236 if($('.accordion-box').length){ 237 $(".accordion-box").on('click', '.accord-btn', function() { 238 239 if($(this).hasClass('active')!==true){ 240 $('.accordion .accord-btn').removeClass('active'); 241 242 } 243 244 if ($(this).next('.accord-content').is(':visible')){ 245 $(this).removeClass('active'); 246 $(this).next('.accord-content').slideUp(300); 247 }else{ 248 $(this).addClass('active'); 249 $('.accordion .accord-content').slideUp(300); 250 $(this).next('.accord-content').slideDown(300); 251 } 252 }); 253 } 254 255 256 //Tabs / Jquery Tabs 257 if($('.tabs-box').length){ 258 259 //Tabs 260 $('.tabs-box .tab-buttons .tab-btn').on('click', function(e) { 261 e.preventDefault(); 262 var target = $($(this).attr('data-tab')); 263 $('.tabs-box .tab-buttons .tab-btn').removeClass('active-btn'); 264 $(this).addClass('active-btn'); 265 $('.tabs-box .tabs-content .tab').hide(0); 266 $('.tabs-box .tabs-content .tab').removeClass('active-post'); 267 $(target).fadeIn(300); 268 $(target).addClass('active-post'); 269 var windowWidth = $(window).width(); 270 if (windowWidth < 600) { 271 $('html, body').animate({ 272 scrollTop: $('.tabs-content').offset().top 273 }, 1000); 274 } 275 }); 276 277 } 278 279 //Product Tabs 280 if($('.prod-tabs .tab-btn').length){ 281 $('.prod-tabs .tab-btn').on('click', function(e) { 282 e.preventDefault(); 283 var target = $($(this).attr('href')); 284 $('.prod-tabs .tab-btn').removeClass('active-btn'); 285 $(this).addClass('active-btn'); 286 $('.prod-tabs .tab').fadeOut(0); 287 $('.prod-tabs .tab').removeClass('active-tab'); 288 $(target).fadeIn(500); 289 $(target).addClass('active-tab'); 290 }); 291 292 } 293 294 295 //Jquery Spinner / Quantity Spinner 296 if($('.quantity-spinner').length){ 297 $("input.quantity-spinner").TouchSpin({ 298 verticalbuttons: true 299 }); 300 } 301 302 303 //Gallery With Filters 304 if($('.filter-list').length){ 305 $('.filter-list').mixItUp({}); 306 } 307 308 309 //Price Range Slider 310 if($('.range-slider-price').length){ 311 312 var priceRange = document.getElementById('range-slider-price'); 313 314 noUiSlider.create(priceRange, { 315 start: [ 25, 100 ], 316 limit: 200, 317 behaviour: 'drag', 318 connect: true, 319 range: { 320 'min': 10, 321 'max': 200 322 } 323 }); 324 325 var limitFieldMin = document.getElementById('min-value-rangeslider'); 326 var limitFieldMax = document.getElementById('max-value-rangeslider'); 327 328 priceRange.noUiSlider.on('update', function( values, handle ){ 329 (handle ? limitFieldMax : limitFieldMin).value = values[handle]; 330 }); 331 } 332 333 334 335 336 //Contact Form Validation 337 if($('#contact-form').length){ 338 $('#contact-form').validate({ 339 rules: { 340 firstname: { 341 required: true 342 }, 343 lastname: { 344 required: true 345 }, 346 phone: { 347 required: true 348 }, 349 subject: { 350 required: true 351 }, 352 message: { 353 required: true 354 } 355 } 356 }); 357 } 358 359 360 // Scroll to a Specific Div 361 if($('.scroll-to-target').length){ 362 $(".scroll-to-target").on('click', function() { 363 var HeaderHeight = $('.header-lower').height(); 364 var target = $(this).attr('data-target'); 365 // animate 366 $('html, body').animate({ 367 scrollTop: $(target).offset().top - HeaderHeight 368 }, 1000); 369 370 }); 371 } 372 373 374 // Elements Animation 375 if($('.wow').length){ 376 var wow = new WOW( 377 { 378 boxClass: 'wow', // animated element css class (default is wow) 379 animateClass: 'animated', // animation css class (default is animated) 380 offset: 0, // distance to the element when triggering the animation (default is 0) 381 mobile: false, // trigger animations on mobile devices (default is true) 382 live: true // act on asynchronously loaded content (default is true) 383 } 384 ); 385 wow.init(); 386 } 387 388/* ========================================================================== 389 When document is ready, do 390 ========================================================================== */ 391 392 $(document).on('ready', function() { 393 customScrollBarHiddenSidebar(); 394 hiddenBarToggler(); 395 hiddenBarMenuConfig(); 396 }); 397 398/* ========================================================================== 399 When document is Scrollig, do 400 ========================================================================== */ 401 402 $(window).on('scroll', function() { 403 headerStyle(); 404 }); 405 406/* ========================================================================== 407 When document is Loaded, do 408 ========================================================================== */ 409 410 $(window).on('load', function() { 411 handlePreloader(); 412 }); 413 414 $(document).on("submit", ".subscribe-form1",function(event) { 415 $.ajax({
416 url : "/subscribe/add_subscribe", 417 type : "POST", 418 dataType : "json", 419 data : {"email" : $('.subscribe-form input').val()}, 420 success : function(data) { 421 if(data.status == 'error'){ 422 $('.subscribe-status').html(data.message); 423 }else{ 424 $('.subscribe-status').html(data.message); 425 } 426 }, 427 error : function(data) { 428 console.log(data); 429 } 430 }); 431 event.preventDefault(); 432 }); 433 434 $(document).on("submit", ".subscribe-form2",function(event) { 435 $.ajax({ 436 url : "/subscribe/add_subscribe", 437 type : "POST", 438 dataType : "json", 439 data : {"email" : $('.subscribe-form2 input').val()}, 440 success : function(data) { 441 if(data.status == 'error'){ 442 $('.subscribe-status2').html(data.message); 443 }else{ 444 $('.subscribe-status2').html(data.message); 445 } 446 }, 447 error : function(data) { 448 console.log(data); 449 } 450 }); 451 event.preventDefault(); 452 }); 453 454 455 456})(window.jQuery); 457
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.