1(function($) { 2 3 "use strict"; 4 5 //Hide Loading Box (Preloader) 6 function handlePreloader() { 7 if($('.loader-wrap').length){ 8 $('.loader-wrap').delay(1000).fadeOut(500); 9 } 10 } 11 12 if ($(".preloader-close").length) { 13 $(".preloader-close").on("click", function(){ 14 $('.loader-wrap').delay(200).fadeOut(500); 15 }) 16 } 17 18 //Update Header Style and Scroll to Top 19 function headerStyle() { 20 if($('.main-header').length){ 21 var windowpos = $(window).scrollTop(); 22 var siteHeader = $('.main-header'); 23 var scrollLink = $('.scroll-top'); 24 if (windowpos >= 110) { 25 siteHeader.addClass('fixed-header'); 26 scrollLink.addClass('open'); 27 } else { 28 siteHeader.removeClass('fixed-header'); 29 scrollLink.removeClass('open'); 30 } 31 } 32 } 33 34 headerStyle(); 35 36 37 //Submenu Dropdown Toggle 38 if($('.main-header li.dropdown ul').length){ 39 $('.main-header .navigation li.dropdown').append('<div class="dropdown-btn"><span class="fas fa-angle-down"></span></div>'); 40 41 } 42 43 //Mobile Nav Hide Show 44 if($('.mobile-menu').length){ 45 46 $('.mobile-menu .menu-box').mCustomScrollbar(); 47 48 var mobileMenuContent = $('.main-header .menu-area .main-menu').html(); 49 $('.mobile-menu .menu-box .menu-outer').append(mobileMenuContent); 50 $('.sticky-header .main-menu').append(mobileMenuContent); 51 52 //Dropdown Button 53 $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { 54 $(this).toggleClass('open'); 55 $(this).prev('ul').slideToggle(500); 56 }); 57 //Dropdown Button 58 $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { 59 $(this).prev('.megamenu').slideToggle(900); 60 }); 61 //Menu Toggle Btn 62 $('.mobile-nav-toggler').on('click', function() { 63 $('body').addClass('mobile-menu-visible'); 64 }); 65 66 //Menu Toggle Btn 67 $('.mobile-menu .menu-backdrop,.mobile-menu .close-btn').on('click', function() { 68 $('body').removeClass('mobile-menu-visible'); 69 }); 70 } 71 72 73 // Scroll to a Specific Div 74 if($('.scroll-to-target').length){ 75 $(".scroll-to-target").on('click', function() { 76 var target = $(this).attr('data-target'); 77 // animate 78 $('html, body').animate({ 79 scrollTop: $(target).offset().top 80 }, 1000); 81 82 }); 83 } 84 85 // Elements Animation 86 if($('.wow').length){ 87 var wow = new WOW({ 88 mobile: false 89 }); 90 wow.init(); 91 } 92 93 //Contact Form Validation 94 if($('#contact-form').length){ 95 $('#contact-form').validate({ 96 rules: { 97 username: { 98 required: true 99 }, 100 email: { 101 required: true, 102 email: true 103 }, 104 phone: { 105 required: true 106 }, 107 subject: { 108 required: true 109 }, 110 message: { 111 required: true 112 } 113 } 114 }); 115 } 116 117 //Fact Counter + Text Count 118 if($('.count-box').length){ 119 $('.count-box').appear(function(){ 120 121 var $t = $(this), 122 n = $t.find(".count-text").attr("data-stop"), 123 r = parseInt($t.find(".count-text").attr("data-speed"), 10); 124 125 if (!$t.hasClass("counted")) { 126 $t.addClass("counted"); 127 $({ 128 countNum: $t.find(".count-text").text() 129 }).animate({ 130 countNum: n 131 }, { 132 duration: r, 133 easing: "linear", 134 step: function() { 135 $t.find(".count-text").text(Math.floor(this.countNum)); 136 }, 137 complete: function() { 138 $t.find(".count-text").text(this.countNum); 139 } 140 }); 141 } 142 143 },{accY: 0}); 144 } 145 146 147 //LightBox / Fancybox 148 if($('.lightbox-image').length) { 149 $('.lightbox-image').fancybox({ 150 openEffect : 'fade', 151 closeEffect : 'fade', 152 helpers : { 153 media : {} 154 } 155 }); 156 } 157 158 159 //Tabs Box 160 if($('.tabs-box').length){ 161 $('.tabs-box .tab-buttons .tab-btn').on('click', function(e) { 162 e.preventDefault(); 163 var target = $($(this).attr('data-tab')); 164 165 if ($(target).is(':visible')){ 166 return false; 167 }else{ 168 target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn'); 169 $(this).addClass('active-btn'); 170 target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0); 171 target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab'); 172 $(target).fadeIn(300); 173 $(target).addClass('active-tab'); 174 } 175 }); 176 } 177 178 179 //Pricing Tabs 180 if($('.pricing-tabs').length){ 181 $('.pricing-tabs .tab-btns .tab-btn').on('click', function(e) { 182 e.preventDefault(); 183 var target = $($(this).attr('data-tab')); 184 185 if ($(target).hasClass('actve-tab')){ 186 return false; 187 }else{ 188 $('.pricing-tabs .tab-btns .tab-btn').removeClass('active-btn'); 189 $(this).addClass('active-btn'); 190 $('.pricing-tabs .pr-content .pr-tab').removeClass('active-tab'); 191 $(target).addClass('active-tab'); 192 } 193 }); 194 } 195 196 197 198 //Accordion Box 199 if($('.accordion-box').length){ 200 $(".accordion-box").on('click', '.acc-btn', function() { 201 202 var outerBox = $(this).parents('.accordion-box'); 203 var target = $(this).parents('.accordion'); 204 205 if($(this).hasClass('active')!==true){ 206 $(outerBox).find('.accordion .acc-btn').removeClass('active'); 207 } 208 209 if ($(this).next('.acc-content').is(':visible')){ 210 return false; 211 }else{ 212 $(this).addClass('active'); 213 $(outerBox).children('.accordion').removeClass('active-block'); 214 $(outerBox).find('.accordion').children('.acc-content').slideUp(300); 215 target.addClass('active-block'); 216 $(this).next('.acc-content').slideDown(300); 217 } 218 }); 219 } 220 221 222 // banner-carousel 223 if ($('.banner-carousel').length) { 224 $('.banner-carousel').owlCarousel({ 225 loop:true, 226 margin:0, 227 nav:true, 228 animateOut: 'fadeOut', 229 animateIn: 'fadeIn', 230 active: true, 231 smartSpeed: 1000, 232 autoplay: 6000, 233 navText: [ '<span class="far fa-long-arrow-left"></span>', '<span class="far fa-long-arrow-right"></span>' ], 234 responsive:{ 235 0:{ 236 items:1 237 }, 238 600:{ 239 items:1 240 }, 241 800:{ 242 items:1 243 }, 244 1024:{ 245 items:1 246 } 247 } 248 }); 249 } 250 251 252 //two-column-carousel 253 if ($('.two-column-carousel').length) { 254 $('.two-column-carousel').owlCarousel({ 255 loop:true, 256 margin:30, 257 nav:true, 258 smartSpeed: 1000, 259 autoplay: 500, 260 navText: [ '<span class="fas fa-algle-left"></span>', '<span class="fas fa-algle-left-right"></span>' ], 261 responsive:{ 262 0:{ 263 items:1 264 }, 265 480:{ 266 items:1 267 }, 268 600:{ 269 items:1 270 }, 271 800:{ 272 items:2 273 }, 274 1024:{ 275 items:2 276 } 277 } 278 }); 279 } 280 281 282 //three-item-carousel 283 if ($('.three-item-carousel').length) { 284 $('.three-item-carousel').owlCarousel({ 285 loop:true, 286 margin:30, 287 nav:true, 288 smartSpeed: 1000, 289 autoplay: 500, 290 navText: [ '<span class="far fa-long-arrow-alt-left"></span>', '<span class="far fa-long-arrow-alt-right"></span>' ], 291 responsive:{ 292 0:{ 293 items:1 294 }, 295 480:{ 296 items:1 297 }, 298 600:{ 299 items:2 300 }, 301 800:{ 302 items:2 303 }, 304 1024:{ 305 items:3 306 } 307 } 308 }); 309 } 310 311 312 // Four Item Carousel 313 if ($('.four-item-carousel').length) { 314 $('.four-item-carousel').owlCarousel({ 315 loop:true, 316 margin:30, 317 nav:true, 318 smartSpeed: 500, 319 autoplay: 5000, 320 navText: [ '<span class="fas fa-angle-left"></span>', '<span class="fas fa-angle-right"></span>' ], 321 responsive:{ 322 0:{ 323 items:1 324 }, 325 600:{ 326 items:2 327 }, 328 800:{ 329 items:2 330 }, 331 1024:{ 332 items:3 333 }, 334 1200:{ 335 items:4 336 } 337 } 338 }); 339 } 340 341 342 // single-item-carousel 343 if ($('.single-item-carousel').length) { 344 $('.single-item-carousel').owlCarousel({ 345 loop:true, 346 margin:30, 347 nav:false, 348 smartSpeed: 500, 349 autoplay: 1000, 350 navText: [ '<span class="icon-Left-Arrow"></span>', '<span class="icon-Right-Arrow"></span>' ], 351 responsive:{ 352 0:{ 353 items:1 354 }, 355 480:{ 356 items:1 357 }, 358 600:{ 359 items:1 360 }, 361 800:{ 362 items:1 363 }, 364 1200:{ 365 items:1 366 } 367 368 } 369 }); 370 } 371 372 373 // clients-carousel 374 if ($('.clients-carousel').length) { 375 $('.clients-carousel').owlCarousel({ 376 loop:true, 377 margin:30, 378 nav:false, 379 smartSpeed: 3000, 380 autoplay: true, 381 navText: [ '<span class="fas fa-angle-left"></span>', '<span class="fas fa-angle-right"></span>' ], 382 responsive:{ 383 0:{ 384 items:1 385 }, 386 480:{ 387 items:2 388 }, 389 600:{ 390 items:3 391 }, 392 800:{ 393 items:4 394 }, 395 1200:{ 396 items:5 397 } 398 399 } 400 }); 401 } 402 403 404 //Add One Page nav 405 if($('.scroll-nav').length) { 406 $('.scroll-nav').onePageNav(); 407 } 408 409 //Sortable Masonary with Filters 410 function enableMasonry() { 411 if($('.sortable-masonry').length){ 412 413 var winDow = $(window); 414 // Needed variables 415 var $container=$('.sortable-masonry .items-container'); 416 var $filter=$('.filter-btns'); 417 418 $container.isotope({ 419 filter:'*', 420 masonry: { 421 columnWidth : '.masonry-item.small-column' 422 }, 423 animationOptions:{ 424 duration:500, 425 easing:'linear' 426 } 427 }); 428 429 430 // Isotope Filter 431 $filter.find('li').on('click', function(){ 432 var selector = $(this).attr('data-filter'); 433 434 try { 435 $container.isotope({ 436 filter : selector, 437 animationOptions: { 438 duration: 500, 439 easing : 'linear', 440 queue : false 441 } 442 });
443 } catch(err) { 444 445 } 446 return false; 447 }); 448 449 450 winDow.on('resize', function(){ 451 var selector = $filter.find('li.active').attr('data-filter'); 452 453 $container.isotope({ 454 filter : selector, 455 animationOptions: { 456 duration: 500, 457 easing : 'linear', 458 queue : false 459 } 460 }); 461 }); 462 463 464 var filterItemA = $('.filter-btns li'); 465 466 filterItemA.on('click', function(){ 467 var $this = $(this); 468 if ( !$this.hasClass('active')) { 469 filterItemA.removeClass('active'); 470 $this.addClass('active'); 471 } 472 }); 473 } 474 } 475 476 enableMasonry(); 477 478 479 //Price Range Slider 480 if($('.price-range-slider').length){ 481 $( ".price-range-slider" ).slider({ 482 range: true, 483 min: 120, 484 max: 500, 485 values: [ 120, 300 ], 486 slide: function( event, ui ) { 487 $( "input.property-amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] ); 488 } 489 }); 490 491 $( "input.property-amount" ).val( $( ".price-range-slider" ).slider( "values", 0 ) + " - $" + $( ".price-range-slider" ).slider( "values", 1 ) ); 492 } 493 494 495 // Progress Bar 496 if ($('.count-bar').length) { 497 $('.count-bar').appear(function(){ 498 var el = $(this); 499 var percent = el.data('percent'); 500 $(el).css('width',percent).addClass('counted'); 501 },{accY: -50}); 502 503 } 504 505 506 // page direction 507 function directionswitch() { 508 if ($('.page_direction').length) { 509 510 $('.direction_switch button').on('click', function() { 511 $('body').toggleClass(function(){ 512 return $(this).is('.rtl, .ltr') ? 'rtl ltr' : 'rtl'; 513 }) 514 }); 515 }; 516 } 517 518 519 //nice select 520 $(document).ready(function() { 521 $('select:not(.ignore)').niceSelect(); 522 }); 523 524 525 //Jquery Spinner / Quantity Spinner 526 if($('.quantity-spinner').length){ 527 $("input.quantity-spinner").TouchSpin({ 528 verticalbuttons: true 529 }); 530 } 531 532 533 534 /* ========================================================================= 535 When document is Scrollig, do 536 ========================================================================== */ 537 538 jQuery(document).on('ready', function () { 539 (function ($) { 540 // add your functions 541 directionswitch(); 542 })(jQuery); 543 }); 544 545 546 547 /* ========================================================================== 548 When document is Scrollig, do 549 ========================================================================== */ 550 551 $(window).on('scroll', function() { 552 headerStyle(); 553 }); 554 555 556 557 /* ========================================================================== 558 When document is loaded, do 559 ========================================================================== */ 560 561 $(window).on('load', function() { 562 handlePreloader(); 563 enableMasonry(); 564 }); 565 566 567 568})(window.jQuery);
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.