1(function ($) { 2 "use strict"; 3 4 /*------------------------------------------------------------------ 5 [Table of contents] 6 7 1. my owl function 8 2. smooth scroll 9 3. custom input type number function 10 4. custom input type select function 11 5. email patern 12 6. equalheight function 13 7. pricing fixedtable function 14 8. content to center banner section 15 9. prelaoder 16 10. preloader close button 17 11. mega navigation menu init 18 12. twitter api init 19 13. client slider 20 14. testimonial slider 21 15. blog post gallery slider 22 16. contact form init 23 17. video popup init 24 18. Side Offset cart menu open 25 19. wow animation init 26 20. my custom select init 27 21. tab swipe indicator 28 22. pricing matrix expand slider 29 23. feature section prev class get function 30 24. pricing expand function 31 25. accordion add class "isActive" function 32 26. click and go to current section init 33 27. input number increase 34 28. right click , ctrl+u and ctrl+shift+i disabled 35 29. image dragable false setup 36 30. ajaxchimp init 37 31. XpeedStudio Maps 38 39 40 41 42 -------------------------------------------------------------------*/ 43 44 //Demo Script 45 $(".flag-lists li a").on('click', function (event) { 46 alert("Hostinza supports WPML plugin! The language list will be automatically added to your pages when you install the plugin. "); 47 event.preventDefault(); 48 return; 49 }); 50 51 /*========================================================== 52 1. my owl function 53 ======================================================================*/ 54 $.fn.myOwl = function (options) { 55 56 var settings = $.extend({ 57 items: 1, 58 dots: false, 59 loop: true, 60 mouseDrag: true, 61 touchDrag: true, 62 nav: false, 63 autoplay: false, 64 navText: ['', ''], 65 margin: 0, 66 stagePadding: 0, 67 autoplayTimeout: 5000, 68 autoplayHoverPause: true, 69 navRewind: false, 70 responsive: {}, 71 animateOut: '', 72 animateIn: '', 73 smartSpeed: 900, 74 center: '' 75 }, options); 76 77 return this.owlCarousel({ 78 items: settings.items, 79 loop: settings.loop, 80 mouseDrag: settings.mouseDrag, 81 touchDrag: settings.touchDrag, 82 nav: settings.nav, 83 navText: settings.navText, 84 dots: settings.dots, 85 margin: settings.margin, 86 stagePadding: settings.stagePadding, 87 autoplay: settings.autoplay, 88 autoplayTimeout: settings.autoplayTimeout, 89 autoplayHoverPause: settings.autoplayHoverPause, 90 animateOut: settings.animateOut, 91 animateIn: settings.animateIn, 92 responsive: settings.responsive, 93 navRewind: settings.navRewind, 94 center: settings.center, 95 smartSpeed: settings.smartSpeed 96 }); 97 }; 98 99 /*========================================================== 100 2. smooth scroll 101 ======================================================================*/ 102 $.fn.scrollView = function () { 103 return this.each(function () { 104 $('html, body').animate({ 105 scrollTop: $(this).offset().top 106 }, 1000); 107 }); 108 } 109 110 111 /*========================================================== 112 3. custom input type number function 113 ======================================================================*/ 114 $.fn.customNumber = function (options) { 115 var settings = $.extend({ 116 plusIcon: '', 117 minusIcon: '' 118 }, options); 119 120 this.append('<span class="add">' + settings.plusIcon + '</span>'); 121 this.append('<span class="sub">' + settings.minusIcon + '</span>'); 122 123 return this.each(function () { 124 let spinner = $(this), 125 input = spinner.find('input[type="number"]'), 126 add = spinner.find('.add'), 127 sub = spinner.find('.sub'); 128 129 input.parent().on('click', '.sub', function (event) { 130 event.preventDefault(); 131 if (input.val() > parseInt(input.attr('min'), 10)) { 132 input.val(function (i, oldvalue) { 133 return --oldvalue; 134 }) 135 } 136 }); 137 input.parent().on('click', '.add', function (event) { 138 event.preventDefault(); 139 if (input.val() < parseInt(input.attr('max'), 10)) { 140 input.val(function (i, oldvalue) { 141 return ++oldvalue; 142 }) 143 } 144 }); 145 }); 146 } 147 148 149 /*========================================================== 150 4. custom input type select function 151 ======================================================================*/ 152 $.fn.mySelect = function (options) {
153 let $this = $(this), 154 numberOfOptions = $(this).children('option'); 155 156 $this.addClass('select-hidden'); 157 $this.wrap('<div class="select"></div>'); 158 $this.after('<div class="select-styled"></div>'); 159 160 let styledSelect = $this.next('.select-styled'); 161 styledSelect.text($this.children('option').eq(0).text()); 162 163 let list = $('<ul />', { 164 'class': 'select-options' 165 }).insertAfter(styledSelect); 166 167 for (let i = 0; i < numberOfOptions.length; i++) { 168 $('<li />', { 169 text: $this.children('option').eq(i).text(), 170 rel: $this.children('option').eq(i).val() 171 }).appendTo(list); 172 } 173 174 let listItems = list.children('li'); 175 176 styledSelect.on('click', function (e) { 177 e.stopPropagation(); 178 $('.select-styled.active').not(this).each(function () { 179 $(this).removeClass('active').next('.select-options').fadeIn(); 180 }); 181 $(this).toggleClass('active').next('.select-options').toggle(); 182 $(this).parent().toggleClass('focus'); 183 }); 184 185 listItems.on('click', function (e) { 186 e.stopPropagation(); 187 styledSelect.text($(this).text()).removeClass('active'); 188 $this.val($(this).attr('rel')); 189 list.hide(); 190 if ($(this).parent().parent().hasClass('focus')) { 191 $(this).parent().parent().removeClass('focus'); 192 } 193 }); 194 195 $(document).on('click', function () { 196 styledSelect.removeClass('active'); 197 list.hide(); 198 }); 199 } 200 201 if ($('.xs-domain-search').length > 0) { 202 $('.xs-domain-search').mySelect(); 203 } 204 /*========================================================== 205 5. email patern 206 ======================================================================*/ 207 function email_pattern(email) { 208 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 209 return regex.test(email); 210 } 211 212 213 /*========================================================== 214 6. equalheight function 215 ======================================================================*/ 216 function equalHeight() { 217 let pricingImage = $('.pricing-image'), 218 pricingFeature = $('.pricing-feature-group'); 219 220 if ($(window).width() > 991) { 221 pricingImage.css('height', pricingFeature.outerHeight()); 222 } else { 223 pricingImage.css('height', 100 + '%'); 224 } 225 } 226 227 228 /*========================================================== 229 7. pricing fixedtable function 230 ======================================================================*/ 231 function fixedtabel() { 232 233 let table = $('.xs-table'); 234 235 if (!($(window).width() > 576)) { 236 if ($('.xs-table.fixed-column').length === 0) { 237 let fixedCol = table.clone().insertBefore(table).addClass('fixed-column'); 238 } 239 } else { 240 $('.xs-table.fixed-column').remove(); 241 } 242 let fixedCol = $('.xs-table.fixed-column'); 243 fixedCol.find('th:not(:first-child),td:not(:first-child)').remove(); 244 245 fixedCol.find('tr').each(function (i, elem) { 246 $(this).height(table.find('tr:eq(' + i + ')').height()); 247 }); 248 }; 249 250 /*========================================================== 251 8. content to center banner section 252 ======================================================================*/ 253 function centerContent() { 254 let content = $('.contet-to-center > .container'), 255 header = $('.header-transparent'); 256 257 if ($(window).width() > 991) { 258 content.css('margin-top', header.outerHeight()); 259 } else { 260 content.css('margin-top', 0 + 'px'); 261 } 262 } 263 264 function removebrtag() { 265 let content = $('#bridge #main-menu .navbar-nav li a'); 266 $(content).each(function (index, el) { 267 $('br').remove(); 268 }) 269 } 270 271 function stickyHeader() { 272 var mainheader = $('.nav-sticky'), 273 height = mainheader.outerHeight(), 274 scroll = $(document).scrollTop(); 275 $(window).on('load', function () { 276 if ($(document).scrollTop() > height) { 277 if (mainheader.hasClass('sticky-header')) { 278 mainheader.removeClass('sticky-header'); 279 } else { 280 mainheader.addClass('sticky-header'); 281 } 282 } 283 }) 284 $(window).on('scroll', function () { 285 var scrolled = $(document).scrollTop(), 286 header = $('.sticky-header'); 287 if (scrolled > scroll) { 288 header.addClass('sticky'); 289 } else { 290 header.removeClass('sticky'); 291 } 292 if (scrolled === 0) { 293 mainheader.removeClass('sticky-header'); 294 } else { 295 mainheader.addClass('sticky-header'); 296 } 297 scroll = $(document).scrollTop(); 298 }); 299 } 300 301 /*========================================================== 302 10. skew background width calculate function 303 ======================================================================*/ 304 function skewBgWidthCalc() { 305 var skewBg = $('.skew-bg'), 306 width = $(window).width(); 307 skewBg.append('<style>.skew-bg::after{border-left: ' + width + 'px solid transparent}</style>') 308 } 309 310 /*========================================================== 311 11. on screen function 312 ======================================================================*/ 313 $.fn.onScreen = function () { 314 var offset = this.offset(); 315 var win = $(window); 316 var viewport = { 317 top: $(window).scrollTop(), 318 left: $(window).scrollLeft() 319 }; 320 viewport.right = viewport.left + $(window).width(); 321 viewport.bottom = viewport.top + $(window).height(); 322 offset.right = offset.left + this.outerWidth(); 323 offset.bottom = offset.top + this.outerHeight(); 324 return !(viewport.right < offset.left || viewport.left > offset.right || viewport.bottom < offset.top || viewport.top > offset.bottom); 325 }; 326 327 /*========================================================== 328 12. set logo function 329 ======================================================================*/ 330 function setLogo() { 331 $('.xs-logo').each(function () { 332 var $this = $(this).children(), 333 clone = $this.clone(), 334 holder = $('.nav-brand'); 335 if ($(window).width() > 991) { 336 if (holder.children().length > 0) { 337 holder.children().remove(); 338 } 339 } else { 340 if (holder.children().length === 0) { 341 holder.append(clone); 342 } 343 } 344 }); 345 } 346 347 function menuTigger () { 348 $('.nav .dropdown').on('click', function () { 349 if ($(this).hasClass('open')) { 350 $(this).removeClass('open') 351 } else { 352 $(this).addClass('open') 353 } 354 }) 355 $(window).on('resize', function () { 356 if ($(window).width() > 991) { 357 if ($('.nav .dropdown').hasClass('open')) { 358 $('.nav .dropdown').removeClass('open') 359 } 360 } 361 }) 362 } 363 364 $(window).on('load', function () { 365 366 $('.menu-item-object-mega_menu').each(function () { 367 var parent = $(this).parents('.menu-item'); 368 if (parent.hasClass('xs-megamenu')) { 369 parent.removeClass('xs-megamenu') 370 } else { 371 parent.addClass('xs-megamenu') 372 } 373 }) 374 375 // equal hight init 376 equalHeight(); 377 // fixedtable init 378 fixedtabel(); 379 // center content 380 centerContent(); 381 382 removebrtag(); 383 384 // sticky header init 385 stickyHeader(); 386 387 // set logo 388 setLogo(); 389 390 if ($('<style>.skew-bg::after</style>').length > 0) { 391 skewBgWidthCalc(); 392 } 393 394 /*========================================================== 395 9. prelaoder 396 ======================================================================*/ 397 $('#preloader').addClass('loaded'); 398 399 }); // END load Function 400 401 $(document).ready(function () { 402 // equal hight init 403 equalHeight(); 404 // fixedtable init 405 fixedtabel(); 406 // center content 407 centerContent(); 408 409 removebrtag(); 410 411 // sticky header init 412 stickyHeader(); 413 414 // set logo 415 setLogo(); 416 417 menuTigger (); 418 419 if ($('<style>.skew-bg::after</style>').length > 0) { 420 skewBgWidthCalc(); 421 } 422 var domain_query; 423 var query; 424 $('.domain-search-form input[name="domain_query"]').on('keyup', function () { 425 domain_query = $('.domain-search-form').find('input[name="domain_query"]').val(); 426 query = domain_query + '' + $('.select-styled').text(); 427 $('.domain-search-form input[name="query"]').attr('value', query); 428 }) 429 $('.select-options li').on('click', function () { 430 domain_query = $('.domain-search-form').find('input[name="domain_query"]').val(); 431 query = domain_query + '' + $(this).text(); 432 $('.domain-search-form input[name="query"]').attr('value', query); 433 }) 434 435 $('.pure-form .select-options li').on('click', function () { 436 var sld = $('.domain-search-form').find('input[name="domain"]').val(); 437 if ($('.select-styled').text() != 'All') { 438 sld = sld.split('.', 1)[0]; 439 var domain = sld + '' + $('.select-styled').text(); 440 $('.domain-search-form input[name="domain"]').attr('value', domain); 441 } else { 442 sld = sld.split('.', 1)[0]; 443 $('.domain-search-form input[name="domain"]').attr('value', sld); 444 } 445 }) 446 447 448 $('#bridge p').each(function () { 449 var $this = $(this); 450 if ($this.html().replace(/\s| /g, '').length == 0) 451 $this.remove(); 452 }); 453 454 /*========================================================== 455 10. preloader close button 456 ======================================================================*/ 457 $('.prelaoder-btn').on('click', function (e) { 458 e.preventDefault(); 459 if (!($('#preloader').hasClass('loaded'))) { 460 $('#preloader').addClass('loaded'); 461 } 462 }) 463 464 /*========================================================== 465 11. mega navigation menu init 466 ======================================================================*/ 467 if ($('.xs-menus').length > 0) { 468 $('.xs-menus').xs_nav({ 469 mobileBreakpoint: 992, 470 }); 471 } 472 473 474 /*========================================================== 475 13. client slider 476 ======================================================================*/ 477 if ($('.xs-client-slider').length > 0) { 478 $('.xs-client-slider').myOwl({ 479 items: 5, 480 responsive: { 481 0: { 482 items: 1 483 }, 484 768: { 485 items: 3 486 }, 487 1024: { 488 items: 5 489 } 490 } 491 }); 492 } 493 494 /*========================================================== 495 14. testimonial slider 496 ======================================================================*/ 497 if ($('.xs-testimonial-slider').length > 0) { 498 $('.xs-testimonial-slider').myOwl({ 499 items: 3, 500 center: true, 501 animateOut: 'fadeOut', 502 animateIn: 'fadeIn', 503 margin: 30, 504 responsive: { 505 0: { 506 items: 1 507 }, 508 768: { 509 items: 2 510 }, 511 1024: { 512 items: 3 513 } 514 } 515 }); 516 } 517 /*========================================================== 518 19. testimonial slider 2 519 ======================================================================*/ 520 if ($('.xs-testimonial-slider-2').length > 0) { 521 $('.xs-testimonial-slider-2').myOwl({ 522 items: 3, 523 center: true, 524 animateOut: 'fadeOut', 525 animateIn: 'fadeIn', 526 dots: true, 527 responsive: { 528 0: { 529 items: 1 530 }, 531 920: { 532 items: 2 533 }, 534 1024: { 535 items: 3 536 } 537 } 538 }); 539 } 540 /*========================================================== 541 15. blog post gallery slider 542 ======================================================================*/ 543 if ($('.post-gallery-slider').length > 0) { 544 $('.post-gallery-slider').myOwl({ 545 nav: true, 546 navText: ['<i class="icon icon-arrow-left"></i>', '<i class="icon icon-arrow-right"></i>'], 547 responsive: { 548 0: { 549 nav: false 550 } 551 } 552 }); 553 } 554 555 /*========================================================== 556 16. contact form init 557 ======================================================================*/ 558 559 $(document).on('submit', '#xs-contact-form', function (event) { 560 event.preventDefault(); 561 /* Act on the event */ 562 563 var xs_contact_name = $('#xs_contact_name'), 564 xs_contact_email = $('#xs_contact_email'), 565 xs_contact_website = $('#xs_contact_website'), 566 x_contact_massage = $('#x_contact_massage'), 567 xs_contact_submit = $('#xs_contact_submit'), 568 xs_contact_error = false;
569 570 $('.xpeedStudio_success_message').remove(); 571 572 if (xs_contact_name.val().trim() === '') { 573 xs_contact_name.addClass('invaild'); 574 xs_contact_error = true; 575 xs_contact_name.focus(); 576 return false; 577 } else { 578 xs_contact_name.removeClass('invaild'); 579 } 580 if (xs_contact_email.val().trim() === '') { 581 xs_contact_email.addClass('invaild'); 582 xs_contact_error = true; 583 xs_contact_email.focus(); 584 return false; 585 } else if (!email_pattern(xs_contact_email.val().toLowerCase())) { 586 xs_contact_email.addClass('invaild'); 587 xs_contact_error = true; 588 xs_contact_email.focus(); 589 return false; 590 } else { 591 xs_contact_email.removeClass('invaild'); 592 } 593 if (xs_contact_website.val().trim() === '') { 594 xs_contact_website.addClass('invaild'); 595 xs_contact_error = true; 596 xs_contact_website.focus(); 597 return false; 598 } else { 599 xs_contact_website.removeClass('invaild'); 600 } 601 if (x_contact_massage.val().trim() === '') { 602 x_contact_massage.addClass('invaild'); 603 xs_contact_error = true; 604 x_contact_massage.focus(); 605 return false; 606 } else { 607 x_contact_massage.removeClass('invaild'); 608 } 609 610 if (xs_contact_error === false) { 611 xs_contact_submit.before().hide().fadeIn(); 612 $.ajax({ 613 type: "POST", 614 url: "assets/php/contact-form.php", 615 data: { 616 'xs_contact_name': xs_contact_name.val(), 617 'xs_contact_email': xs_contact_email.val(), 618 'xs_contact_website': xs_contact_website.val(), 619 'x_contact_massage': x_contact_massage.val(), 620 }, 621 success: function (result) { 622 xs_contact_submit.after('<p class="xpeedStudio_success_message">' + result + '</p>').hide().fadeIn(); 623 624 setTimeout(function () { 625 $(".xpeedStudio_success_message").fadeOut(1000, function() { 626 $(this).remove(); 627 }) 628 }, 5000); 629 630 $('#xs-contact-form')[0].reset(); 631 } 632 }); 633 } 634 }); 635 636 // off autocomplete 637 $('input').each(function (e) { 638 $(this).attr('autocomplete', 'off'); 639 $(this).attr('autocorrect', 'off'); 640 }); 641 642 643 $('.xs-service-block').on('mouseenter', function () { 644 if (!$(this).hasClass('active')) { 645 $(this).addClass('active') 646 } 647 }); 648 $('.xs-service-block').on('mouseleave', function (e) { 649 if ($(this).hasClass('active')) { 650 $(this).removeClass('active'); 651 } 652 }); 653 654 655 /*========================================================== 656 17. video popup init 657 ======================================================================*/ 658 if ($('.xs-video-popup').length > 0) { 659 $('.xs-video-popup').magnificPopup({ 660 disableOn: 700, 661 type: 'iframe', 662 mainClass: 'mfp-fade', 663 removalDelay: 160, 664 preloader: false, 665 fixedContentPos: false 666 }); 667 } 668 669 /*========================================================== 670 18. Side Offset cart menu open 671 ======================================================================*/ 672 673 if ($('.close-side-widget').length > 0) { 674 $('.close-side-widget').on('click', function (e) { 675 e.preventDefault(); 676 $('.cart-group').removeClass('isActive'); 677 }); 678 } 679 if ($('.navSidebar-button').length > 0) { 680 $('.navSidebar-button').on('click', function (e) { 681 e.preventDefault(); 682 e.stopPropagation(); 683 $('.info-group').addClass('isActive'); 684 }); 685 } 686 if ($('.close-side-widget').length > 0) { 687 $('.close-side-widget').on('click', function (e) { 688 e.preventDefault(); 689 $('.info-group').removeClass('isActive'); 690 }); 691 } 692 $('body').on('click', function (e) { 693 $('.info-group').removeClass('isActive'); 694 $('.cart-group').removeClass('isActive'); 695 }); 696 $('.xs-sidebar-widget').on('click', function (e) { 697 e.stopPropagation(); 698 }); 699 700 /*============================================================= 701 19. wow animation init 702 =========================================================================*/ 703 $(function () { 704 var wow = new WOW({ 705 boxClass: 'wow', 706 animateClass: 'animated', 707 offset: 0, 708 mobile: false, 709 live: true, 710 scrollContainer: null, 711 }); 712 wow.init(); 713 }); 714 715 /*============================================================= 716 20. my custom select init 717 =========================================================================*/ 718 719 /*============================================================= 720 21. tab swipe indicator 721 =========================================================================*/ 722 if ($('.tab-swipe').length > 0) { 723 $('.tab-swipe').append('<li class="indicator"></li>'); 724 if ($('.tab-swipe li a').hasClass('active')) { 725 let cLeft = $('.tab-swipe li a.active').position().left + 'px', 726 cWidth = $('.tab-swipe li a.active').css('width'); 727 $('.indicator').css({ 728 left: cLeft, 729 width: cWidth 730 }) 731 } 732 $('.tab-swipe li a').on('click', function () { 733 $('.tab-swipe li a').removeClass('isActive'); 734 $(this).addClass('isActive'); 735 let cLeft = $('.tab-swipe li a.isActive').position().left + 'px', 736 cWidth = $('.tab-swipe li a.isActive').css('width'); 737 $('.indicator').css({ 738 left: cLeft, 739 width: cWidth 740 }) 741 }); 742 } 743 744 /*============================================================= 745 22. pricing matrix expand slider 746 =========================================================================*/ 747 if ($('.pricing-matrix-slider').length > 0) { 748 $('.pricing-matrix-slider').on('initialized.owl.carousel translated.owl.carousel', function () { 749 var $this = $(this); 750 $this.find('.owl-item.last-child').each(function () { 751 $(this).removeClass('last-child'); 752 }); 753 $(this).find('.owl-item.active').last().addClass('last-child'); 754 }); 755 let sliderItems = $(this).find('.pricing-matrix-slider .pricing-matrix-item').length; 756 let slideControl = null; 757 if (sliderItems <= 3) { 758 slideControl = false;
759 } else if (sliderItems >= 4){ 760 slideControl = true; 761 } else { 762 return; 763 } 764 $('.pricing-matrix-slider').myOwl({ 765 items: 3, 766 mouseDrag: slideControl, 767 autoplay: slideControl, 768 nav: true, 769 navText: ['<i class="icon icon-arrow-right"></i>', '<i class="icon icon-arrow-left"></i>'], 770 loop: false, 771 responsive: { 772 0: { 773 items: 1, 774 mouseDrag: true, 775 loop: true, 776 }, 777 768: { 778 items: 2, 779 mouseDrag: true 780 }, 781 1024: { 782 items: 3, 783 mouseDrag: slideControl, 784 autoplay: slideControl, 785 } 786 } 787 }); 788 } 789 790 /*============================================================= 791 23. feature section prev class get function 792 =========================================================================*/ 793 if ($('.xs-feature-section').length > 0) { 794 if ($('.xs-feature-section').prev().hasClass('xs-bg-gray')) { 795 $('.xs-feature-section').addClass('xs-bg-gray'); 796 } else { 797 $('.xs-feature-section').removeClass('xs-bg-gray'); 798 } 799 if ($('.xs-footer-section').prev().hasClass('xs-bg-gray')) { 800 $('.xs-footer-section').children('.xs-feature-section').addClass('xs-bg-gray'); 801 } else { 802 $('.xs-footer-section').children('.xs-feature-section').removeClass('xs-bg-gray'); 803 } 804 }; 805 806 /*============================================================= 807 24. pricing expand function 808 =========================================================================*/ 809 if ($('.pricing-expand').length > 0) { 810 if ($(window).width() > 991) { 811 let pricingContainer = $('.pricing-expand.pricing-matrix'), 812 height = Math.floor(pricingContainer.height()), 813 children = $('.pricing-expand.pricing-matrix .pricing-matrix-slider'), 814 childreHeight = children.height(), 815 gap = $('.pricing-expand.pricing-matrix .gap'), 816 gapHeight = gap.height(), 817 mini = Math.floor((height - ((childreHeight / 2) + (gap.length * 1)))), 818 animSpeed = 500, 819 load_more = $('#load_more_text'), 820 load_more_text = $(load_more).attr('title'); 821 822 823 if (typeof load_more_text !== 'undefined') { 824 pricingContainer.attr('data-height', height + 'px'); 825 pricingContainer.attr('data-min', mini + 'px'); 826 pricingContainer.css('height', mini + 'px'); 827 if ($('.content-collapse-wraper').length === 0) { 828 pricingContainer.after( 829 '<div class="content-collapse-wraper"><a href="#" class="btn btn-primary expand-btn">' + load_more_text + ' <i class="icon icon-arrow_down"></i></a></div>' 830 ); 831 } 832 833 $('.expand-btn').on('click', function (e) { 834 e.preventDefault(); 835 let content = $(this).parent().prev(); 836 content.animate({ 837 'height': content.attr('data-height') 838 }, animSpeed); 839 content.addClass('expand'); 840 $(this).addClass('hide'); 841 }); 842 } 843 } else { 844 if ($('.pricing-matrix').hasClass('pricing-expand')) { 845 $('.pricing-matrix').removeClass('pricing-expand'); 846 console.log('hi') 847 } else { 848 $('.pricing-matrix').removeClass('pricing-expand'); 849 } 850 } 851 } 852 $('.pricing-matrix .gap').prev().addClass('border-bottom-0'); 853 854 /*============================================================= 855 25. accordion add class "isActive" function 856 =========================================================================*/ 857 if ($('.xs-accordion .card-header > a').length > 0) { 858 $('.xs-accordion .card-header > a').on('click', function () { 859 if (!$(this).parent().parent().hasClass('isActive')) { 860 $(this).parent().parent().prevAll().removeClass('isActive'); 861 $(this).parent().parent().nextAll().removeClass('isActive'); 862 $(this).parent().parent().addClass('isActive'); 863 } 864 }); 865 } 866 867 /*============================================================= 868 26. click and go to current section init 869 =========================================================================*/ 870 $('.comment-reply-link').on('click', function (event) { 871 event.preventDefault(); 872 $('#comment-form').scrollView(); 873 }); 874 875 /*============================================================= 876 27. input number increase 877 =========================================================================*/ 878 879 $('.custom_number').customNumber({ 880 plusIcon: '<i class="icon icon-plus"></i>', 881 minusIcon: '<i class="icon icon-minus"></i>' 882 }); 883 884 885 886 $('.elementor-custom-embed-play').each(function () { 887 $(this).addClass('xs-video-popup gloosy-btn'); 888 $(this).find('i').removeClass('eicon-play'); 889 $(this).find('i').addClass('icon icon-play2'); 890 }) 891 $('.elementor-widget-video').each(function () { 892 $(this).append('<div class="xs-overlay xs-bg-black"></div>'); 893 }) 894 895 /*============================================================= 896 29. image dragable false setup 897 =========================================================================*/ 898 $('img').each(function () { 899 $(this).attr('draggable', 'false'); 900 $(this).on('mousedown', function (event) { 901 if (event.preventDefault) { 902 event.preventDefault() 903 } 904 }) 905 }) 906 907 if ($('.wave_animation').length > 0) { 908 $('.wave_animation').parallax(); 909 } 910 911 if ($('.xs-modal-popup').length > 0) { 912 $('.xs-modal-popup').magnificPopup({ 913 type: 'inline',
914 fixedContentPos: false, 915 fixedBgPos: true, 916 overflowY: 'auto', 917 closeBtnInside: false, 918 callbacks: { 919 beforeOpen: function () { 920 this.st.mainClass = "my-mfp-slide-bottom xs-promo-popup"; 921 } 922 } 923 }); 924 } 925 $('[data-toggle="tooltip"]').tooltip(); 926 927 $(document).on('click', '.modal-footer [data-dismiss="modal"]', function () { 928 if ($('#modalEmptyCart').hasClass('show')) { 929 $('#modalEmptyCart').removeClass('show'); 930 } 931 if ($('#modalEmptyCart').attr('style')) { 932 $('#modalEmptyCart').removeAttr('style') 933 } 934 if ($('body.modal-open').attr('style')) { 935 $('body.modal-open').removeAttr('style') 936 } 937 if ($('body').hasClass('modal-open')) { 938 $('body').removeClass('modal-open') 939 } 940 if ($('.modal-backdrop').length > 0) { 941 $('.modal-backdrop').remove(); 942 } 943 }) 944 945 $('.xs-menus').each(function () { 946 let close_icon = $(this).data('close-icon') 947 948 if (close_icon !== undefined && close_icon !== "") { 949 $(this).find('.nav-menus-wrapper-close-button').html('<span class="'+close_icon+'"></span>'); 950 } else { 951 $(this).find('.nav-menus-wrapper-close-button').html('✕'); 952 } 953 }) 954 955 // $('#modalEmptyCart').modal(toggle) 956 }); // end ready function 957 958 $(window).on('scroll', function () { 959 /*========================================================== 960 43. shuffle letters 961 ======================================================================*/ 962 $('.shuffle-letter-title-wraper').each(function (e) { 963 if ($(this).onScreen() && !$(this).hasClass('shuffle-title')) { 964 setTimeout(function () { 965 $(this).find('.shuufle-letter-title').shuffleLetters(); 966 $(this).addClass('shuffle-title'); 967 }.bind(this), 400); 968 } 969 }); 970 }); // END Scroll Function 971 972 $(window).on('resize', function () { 973 // equal hight init 974 equalHeight(); 975 // fixedtable init 976 fixedtabel(); 977 // center content 978 centerContent(); 979 980 // set logo 981 setLogo(); 982 983 if ($('<style>.skew-bg::after</style>').length > 0) { 984 skewBgWidthCalc(); 985 } 986 }); // End Resize 987 988 $('#home-banner').append('<div class="icon-bg"></div>'); 989 990})(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.