1(function($) { 2 3 /* globals jQuery, mfn */ 4 5 "use strict"; 6 7 var scrollTicker, lightboxAttr, sidebar, 8 rtl = $('body').hasClass('rtl'), 9 simple = $('body').hasClass('style-simple'), 10 topBarTop = '61px', 11 headerH = 0, 12 mobileInitW = mfn.mobileInit ? mfn.mobileInit : 1240; 13 14 /** 15 * Lightbox | Magnific Popup 16 */ 17 18 if ( ! mfn.lightbox.disable ) { 19 if ( ! ( mfn.lightbox.disableMobile && ( window.innerWidth < 768 ) ) ) { 20 lightboxAttr = { 21 title: mfn.lightbox.title ? mfn.lightbox.title : false, 22 }; 23 } 24 } 25 26 /** 27 * Admin Bar & WooCommerce Store Notice 28 */ 29 30 function adminBarH() { 31 32 var height = 0; 33 34 // WP adminbar 35 36 if ($('body').hasClass('admin-bar')) { 37 var actionBarH = $('#wpadminbar').innerHeight() || 0; 38 height += actionBarH; 39 } 40 41 // WC demo store 42 43 if ($('body').hasClass('woocommerce-demo-store')) { 44 var demoStoreH = $('body > p.demo_store').innerHeight() || 0; 45 height += demoStoreH; 46 } 47 48 return height; 49 } 50 51 /** 52 * Header | Sticky 53 */ 54 55 function mfnSticky() { 56 57 if( ! $('body').hasClass('sticky-header') ){ 58 return false; 59 } 60 61 if( $('body').hasClass('header-creative') && window.innerWidth >= 768 ){ 62 return false; 63 } 64 65 var startY = headerH; 66 var windowY = $(window).scrollTop(); 67 var topBarH = $('#Top_bar').height() || 0; 68 69 if ( windowY > startY ) { 70 71 if ( ! ( $('#Top_bar').hasClass('is-sticky') ) ) { 72 73 $('.header_placeholder').css('height', topBarH); 74 75 $('#Top_bar') 76 .addClass('is-sticky') 77 .css('top', -60) 78 .animate({ 79 'top': adminBarH() + 'px' 80 }, 300); 81 82 headerWidth(); 83 } 84 85 } else { 86 87 if ($('#Top_bar').hasClass('is-sticky')) { 88 89 $('.header_placeholder').css('height', 0); 90 $('#Top_bar') 91 .removeClass('is-sticky') 92 .css('top', topBarTop); 93 94 stickyLogo(); 95 headerWidth(); 96 97 } 98 99 } 100 101 } 102 103 /** 104 * Header | Sticky | Retina Logo - max height 105 */ 106 107 function stickyLogo() { 108 109 // ! retina display 110 111 if( window.devicePixelRatio <= 1 ){ 112 return false; 113 } 114 115 var parent = $('#Top_bar #logo'), 116 el = $('img.logo-main', parent), 117 height = el.data('height'); 118 119 // ! retina logo set 120 if ( ! parent.hasClass('retina')) { 121 return false; 122 } 123 124 if ( $('body').hasClass('logo-overflow') ) { 125 // do nothing 126 } else if ( height > parent.data('height') ) { 127 height = parent.data('height'); 128 } 129 130 el.css('max-height', height + 'px'); 131 132 } 133 134 /** 135 * Header | Sticky | Height 136 */ 137 138 function mfnStickyH() { 139 140 var topBarH = $('#Top_bar').innerHeight() || 0; 141 142 if ( $('body').hasClass('header-below') ) { 143 144 // header below slider 145 146 var sliderH = $('.mfn-main-slider').innerHeight() || 0; 147 148 headerH = topBarH + sliderH; 149 150 } else { 151 152 // default 153 154 var actionBarH = $('#Action_bar').innerHeight() || 0; 155 156 headerH = topBarH + actionBarH; 157 158 } 159 160 } 161 162 /** 163 * Header | Sticky | Mobile 164 */ 165 166 function mfnMobileSticky() { 167 168 if( ! $('body').hasClass('.mobile-sticky') ){ 169 return false; 170 } 171 172 if( $(window).width() >= 768 ){ 173 return false; 174 } 175 176 var menuH, 177 windowH = $(window).height() || 0, 178 logoH = $('#Top_bar .logo').height() || 0, 179 offset = adminBarH() + logoH; 180 181 if ( ( ! $('#Top_bar').hasClass('is-sticky')) && $('#Action_bar').is(':visible') ) { 182 offset += $('#Action_bar').height() || 0; 183 } 184 185 menuH = windowH - offset; 186 187 if (menuH < 176) { 188 menuH = 176; 189 } 190 191 $('#Top_bar #menu').css('max-height', menuH + 'px'); 192 193 } 194 195 /** 196 * Header | Top bar left | Width 197 */ 198 199 function headerWidth() { 200 var rightW = $('.top_bar_right').innerWidth() || 0; 201 202 if (rightW && !$('body').hasClass('header-plain')) { 203 rightW += 10; 204 } 205 206 var parentW = $('#Top_bar .one').innerWidth() || 0; 207 var leftW = parentW - rightW; 208 209 $('.top_bar_left, .menu > li > ul.mfn-megamenu').css('width', leftW); 210 } 211 212 /** 213 * FIX | Header | Sticky | Height 214 */ 215 216 function fixStickyHeaderH() { 217 218 var stickyH = 0; 219 220 // FIX | sticky top bar height 221 222 var topBar = $('.sticky-header #Top_bar'); 223 224 if (topBar.hasClass('is-sticky')) { 225 stickyH = $('.sticky-header #Top_bar').innerHeight() || 0; 226 } else { 227 topBar.addClass('is-sticky'); 228 stickyH = $('.sticky-header #Top_bar').innerHeight() || 0; 229 topBar.removeClass('is-sticky'); 230 } 231 232 // FIX | responsive 233 234 if ( $(window).width() < mobileInitW ) { 235 236 if ( $(window).width() < 768 ) { 237 238 // mobile 239 if (!$('body').hasClass('mobile-sticky')) { 240 stickyH = 0; 241 } 242 243 } else { 244 245 // tablet 246 if (!$('body').hasClass('tablet-sticky')) { 247 stickyH = 0; 248 } 249 250 } 251 252 } else { 253 254 // desktop 255 256 // FIX | header creative 257 if ($('body').hasClass('header-creative')) { 258 stickyH = 0; 259 } 260 261 } 262 263 return stickyH; 264 } 265 266 /** 267 * Sidebar | Sticky 268 */ 269 270 function mfnSidebarSticky(){ 271 272 var spacing = 0; 273 274 if( ! mfn.sidebarSticky ){ 275 return false;
276 } 277 278 if( ( $('body').hasClass('sticky-header') ) && ( $(window).width() >= mobileInitW ) ){ 279 spacing = 60; 280 } 281 282 sidebar = $('.mcb-sidebar .widget-area').stickySidebar({ 283 topSpacing: spacing 284 }); 285 } 286 287 mfnSidebarSticky(); 288 289 /** 290 * Sidebar | Height 291 */ 292 293 function mfnSidebar() { 294 if ($('.mcb-sidebar').length) { 295 296 var maxH = $('#Content .sections_group').outerHeight(); 297 298 $('.mcb-sidebar').each(function() { 299 $(this).css('min-height', 0); 300 if ($(this).height() > maxH) { 301 maxH = $(this).height(); 302 } 303 }); 304 305 $('.mcb-sidebar').css('min-height', maxH + 'px'); 306 307 if( sidebar ){ 308 sidebar.stickySidebar('updateSticky'); 309 } 310 311 } 312 } 313 314 /** 315 * Section | Full Screen 316 */ 317 318 function mfnSectionH() { 319 320 var windowH = $(window).height() || 0; 321 322 // FIX | next/prev section 323 var offset = 0; 324 if ($('.section.full-screen:not(.hide-desktop)').length > 1) { 325 offset = 5; 326 } 327 328 $('.section.full-screen').each(function() { 329 330 var section = $(this), 331 wrapper = $('.section_wrapper', section); 332 333 section 334 .css('padding', 0) 335 .css('min-height', windowH + offset); 336 337 var wrapperH = wrapper.height() || 0, 338 padding = (windowH + offset - wrapperH) / 2; 339 340 if (padding < 50) padding = 50; 341 342 wrapper 343 .css('padding-top', padding + 10) // 20 = column margin-bottom / 2 344 .css('padding-bottom', padding - 10); 345 }); 346 } 347 348 /** 349 * Equal Height | Wraps 350 */ 351 352 function mfnEqualHeightWrap() { 353 $('.section.equal-height-wrap .section_wrapper').each(function() { 354 var maxH = 0; 355 $( '> .wrap', $(this) ).each( function() { 356 $(this).css('height', 'auto'); 357 if ( $(this).innerHeight() > maxH ) { 358 maxH = $(this).innerHeight(); 359 } 360 }); 361 $('> .wrap', $(this)).css('height', maxH + 'px'); 362 }); 363 } 364 365 /** 366 * Equal Height | Items 367 */ 368 369 function mfnEqualHeight() { 370 $('.section.equal-height .mcb-wrap-inner').each(function() { 371 var maxH = 0; 372 373 $('> .column', $(this)).each(function() { 374 $(this).css('height', 'auto'); 375 if ($(this).height() > maxH) { 376 maxH = $(this).height(); 377 } 378 }); 379 $('> .column', $(this)).css('height', maxH + 'px'); 380 }); 381 } 382 383 384 /** 385 * Into | Full Screen 386 */ 387 388 function mfnIntroH() { 389 390 var windowH = $(window).height() || 0; 391 var headerWrapperH = $('#Header_wrapper').height() || 0; 392 393 windowH = windowH - headerWrapperH - adminBarH(); 394 395 $('#Intro.full-screen').each(function() { 396 397 var el = $(this), 398 inner = $('.intro-inner', el), 399 innerH = inner.height() || 0; 400 401 el.css('padding', 0).css('min-height', windowH); 402 403 var padding = ( windowH - innerH ) / 2; 404 inner.css('padding-top', padding).css('padding-bottom', padding); 405 406 }); 407 } 408 409 /** 410 * Footer | Sliding | Height 411 */ 412 413 function mfnFooter() { 414 415 var footerH = $('#Footer').height() || 0; 416 417 // Fixed, Sliding 418 419 if ($('.footer-fixed #Footer, .footer-sliding #Footer').length) { 420 421 footerH = footerH - 1; 422 $('#Content').css('margin-bottom', footerH + 'px'); 423 424 } 425 426 // Stick to bottom 427 428 if ($('.footer-stick #Footer').length) { 429 430 var headerWrapperH = $('#Header_wrapper').height() || 0; 431 432 var headerFooterH = headerWrapperH + footerH; 433 434 var documentH = $(document).height() - adminBarH(); 435 436 if ( ( documentH <= $(window).height() ) && ( headerFooterH <= $(window).height() ) ) { 437 $('#Footer').addClass('is-sticky'); 438 } else { 439 $('#Footer').removeClass('is-sticky'); 440 } 441 442 } 443 444 } 445 446 /** 447 * Back To Top | Sticky / Show on scroll 448 */ 449 450 function backToTopSticky() { 451 452 if ($('#back_to_top.sticky.scroll').length) { 453 var el = $('#back_to_top.sticky.scroll'); 454 455 // Clear Timeout if one is pending 456 if (scrollTicker) { 457 window.clearTimeout(scrollTicker); 458 scrollTicker = null; 459 } 460 461 el.addClass('focus'); 462 463 // Set Timeout 464 scrollTicker = window.setTimeout(function() { 465 el.removeClass('focus'); 466 }, 1500); // Timeout in msec 467 468 } 469 470 } 471 472 /** 473 * # Hash smooth navigation 474 */ 475 476 function hashNav() { 477 478 var hash = window.location.hash; 479 480 if (hash) { 481 482 // FIX | Master Slider 483 484 if (hash.indexOf("&") > -1 || hash.indexOf("/") > -1) { 485 return false;
486 } 487 488 // Contact Form 7 in popup 489 490 if (hash.indexOf("wpcf7") > -1) { 491 cf7popup(hash); 492 } 493 494 if ($(hash).length) { 495 496 var offset = 0, 497 headerH = fixStickyHeaderH(), 498 tabH = $(hash).siblings('.ui-tabs-nav').innerHeight() || 0; 499 500 // header builder 501 502 if( $('body').hasClass('mhb') ){ 503 504 var currentView = $('.mhb-view').filter(':visible'); 505 headerH = currentView.height() || 0; 506 507 } 508 509 offset = headerH + adminBarH() + tabH; 510 511 $('html, body').animate({ 512 scrollTop: $(hash).offset().top - offset 513 }, 500); 514 } 515 516 } 517 518 } 519 520 /** 521 * One Page | Scroll Active 522 */ 523 524 function onePageActive() { 525 if ($('body').hasClass('one-page')) { 526 527 var stickyH = $('.sticky-header #Top_bar').innerHeight() || 0; 528 var windowT = $(window).scrollTop(); 529 var start = windowT + stickyH + adminBarH() + 1; 530 var first = false; 531 532 $('[data-id]:not(.elementor-element), section[data-id]').each(function() { 533 534 if ($(this).visible(true)) { 535 536 if (!first) { 537 first = $(this); 538 } else if (($(this).offset().top < start) && ($(this).offset().top > first.offset().top)) { 539 first = $(this); 540 } 541 } 542 543 if (first) { 544 545 var newActive = first.attr('data-id'); 546 var active = '[data-hash="' + newActive + '"]'; 547 548 if (newActive) { 549 var menu = $('#menu, .mhb-menu'); 550 menu.find('li').removeClass('current-menu-item current-menu-parent current-menu-ancestor current_page_item current_page_parent current_page_ancestor'); 551 $(active, menu) 552 .closest('li').addClass('current-menu-item') 553 .closest('.menu > li').addClass('current-menu-item'); 554 } 555 556 } 557 558 }); 559 560 } 561 } 562 563 /** 564 * Contact Form 7 | Popup 565 */ 566 567 function cf7popup(hash) { 568 if (hash && $(hash).length) { 569 var id = $(hash).closest('.popup-content').attr('id'); 570 571 $('a.popup-link[href="#' + id + '"]:not(.once)') 572 .addClass('once') 573 .trigger('click'); 574 575 } 576 } 577 578 /** 579 * $(document).ready 580 * Specify a function to execute when the DOM is fully loaded. 581 */ 582 583 $(document).ready(function() { 584 585 /** 586 * Top Bar 587 */ 588 589 $('#Top_bar').removeClass('loading'); 590 591 topBarTop = parseInt($('#Top_bar').css('top'), 10); 592 if (topBarTop < 0) topBarTop = 61; 593 topBarTop = topBarTop + 'px'; 594 595 /** 596 * Menu | Overlay 597 */ 598 599 $('.overlay-menu-toggle').on('click',function(e) { 600 e.preventDefault(); 601 602 $(this).toggleClass('focus'); 603 $('#Overlay').stop(true, true).fadeToggle(500); 604 605 var menuH = $('#Overlay nav').height() || 0; 606 menuH = menuH / 2; 607 608 $('#Overlay nav').css('margin-top', '-' + menuH + 'px'); 609 }); 610 611 $('#Overlay').on('click', '.menu-item > a', function() { 612 $('.overlay-menu-toggle').trigger('click'); 613 }); 614 615 /** 616 * Menu | Responsive | button 617 */ 618 619 $('.responsive-menu-toggle').on('click', function(e) { 620 e.preventDefault(); 621 622 var el = $(this); 623 var menu = $('#Top_bar #menu'); 624 var menuWrap = menu.closest('.top_bar_left'); 625 626 el.toggleClass('active'); 627 628 // sticky menu button 629 if (el.hasClass('is-sticky') && el.hasClass('active') && (window.innerWidth < 768)) { 630 631 var top = 0; 632 if (menuWrap.length) { 633 top = menuWrap.offset().top - adminBarH(); 634 } 635 $('body,html').animate({ 636 scrollTop: top 637 }, 200); 638 639 } 640 641 menu.stop(true, true).slideToggle(200); 642 }); 643 644 /** 645 * Menu | Responsive | Side Slide 646 */ 647 648 function sideSlide() { 649 650 var slide = $('#Side_slide'); 651 var overlay = $('#body_overlay'); 652 var ssMobileInitW = mobileInitW; 653 var pos = 'right'; 654 655 var shiftSlide = -slide.data('width'); 656 var shiftBody = shiftSlide / 2; 657 658 // constructor 659 660 var constructor = function() { 661 if (!slide.hasClass('enabled')) { 662 $('nav#menu').detach().appendTo('#Side_slide .menu_wrapper'); 663 slide.addClass('enabled'); 664 } 665 }; 666 667 // destructor 668 669 var destructor = function() { 670 if (slide.hasClass('enabled')) { 671 close(); 672 $('nav#menu').detach().prependTo('#Top_bar .menu_wrapper'); 673 slide.removeClass('enabled'); 674 } 675 }; 676 677 // reload 678 679 var reload = function() { 680 681 if ( ( window.innerWidth < ssMobileInitW ) ) { 682 constructor(); 683 } else { 684 destructor(); 685 } 686 }; 687 688 // init 689 690 var init = function() { 691 692 if (slide.hasClass('left')) { 693 pos = 'left'; 694 } 695 696 // responsive off 697 if ($('body').hasClass('responsive-off')) { 698 ssMobileInitW = 0; 699 } 700 701 // header simple 702 if ($('body').hasClass('header-simple')) { 703 ssMobileInitW = 9999; 704 } 705 706 reload(); 707 }; 708 709 // reset to default 710 711 var reset = function(time) { 712 713 $('.lang-active.active', slide).removeClass('active').children('i').attr('class', 'icon-down-open-mini'); 714 $('.lang-wrapper', slide).fadeOut(0); 715 716 $('.icon.search.active', slide).removeClass('active'); 717 $('.search-wrapper', slide).fadeOut(0); 718 719 $('.menu_wrapper, .social', slide).fadeIn(time); 720 721 }; 722 723 // menu button 724 725 var button = function() { 726 727 // show 728 729 if (pos == 'left') { 730 slide.animate({ 731 'left': 0 732 }, 300); 733 $('body').animate({ 734 'right': shiftBody 735 }, 300); 736 } else { 737 slide.animate({ 738 'right': 0 739 }, 300); 740 $('body').animate({ 741 'left': shiftBody 742 }, 300); 743 } 744 745 overlay.fadeIn(300); 746 747 // reset 748 749 reset(0); 750 751 }; 752 753 // close 754 755 var close = function() { 756 757 if (pos == 'left') { 758 slide.animate({ 759 'left': shiftSlide 760 }, 300); 761 $('body').animate({ 762 'right': 0 763 }, 300); 764 } else { 765 slide.animate({ 766 'right': shiftSlide 767 }, 300); 768 $('body').animate({ 769 'left': 0 770 }, 300); 771 } 772 773 overlay.fadeOut(300); 774 775 // if page contains revolution slider, trigger resize 776 777 if ($('.rev_slider').length) { 778 setTimeout(function() { 779 $(window).trigger('resize'); 780 }, 300); 781 } 782 783 }; 784 785 // search 786 787 $('.icon.search', slide).on('click', function(e) { 788 789 e.preventDefault(); 790 791 var el = $(this); 792 793 if (el.hasClass('active')) { 794 795 $('.search-wrapper', slide).fadeOut(0); 796 $('.menu_wrapper, .social', slide).fadeIn(300); 797 798 } else { 799 800 $('.search-wrapper', slide).fadeIn(300); 801 $('.menu_wrapper, .social', slide).fadeOut(0); 802 803 $('.lang-active.active', slide).removeClass('active').children('i').attr('class', 'icon-down-open-mini'); 804 $('.lang-wrapper', slide).fadeOut(0); 805 806 } 807 808 el.toggleClass('active'); 809 }); 810 811 // search form submit 812 813 $('a.submit', slide).on('click', function(e) { 814 e.preventDefault(); 815 $('#side-form').submit(); 816 }); 817 818 // lang menu 819 820 $('.lang-active', slide).on('click', function(e) { 821 e.preventDefault(); 822 823 var el = $(this); 824 825 if (el.hasClass('active')) { 826 827 $('.lang-wrapper', slide).fadeOut(0); 828 $('.menu_wrapper, .social', slide).fadeIn(300); 829 el.children('i').attr('class', 'icon-down-open-mini'); 830 831 } else { 832 833 $('.lang-wrapper', slide).fadeIn(300); 834 $('.menu_wrapper, .social', slide).fadeOut(0); 835 el.children('i').attr('class', 'icon-up-open-mini'); 836 837 $('.icon.search.active', slide).removeClass('active'); 838 $('.search-wrapper', slide).fadeOut(0); 839 840 } 841 842 el.toggleClass('active'); 843 }); 844 845 // init, click, debouncedresize 846 847 // init 848 849 init(); 850 851 // click | menu button 852 853 $('.responsive-menu-toggle').off('click'); 854 855 $('.responsive-menu-toggle').on('click', function(e) { 856 e.preventDefault(); 857 button(); 858 }); 859 860 // click | close 861 862 overlay.on('click', function(e) { 863 close(); 864 }); 865 866 $('.close', slide).on('click', function(e) { 867 e.preventDefault(); 868 close(); 869 }); 870 871 // click | below search or languages menu 872 873 $(slide).on('click', function(e) { 874 if ($(e.target).is(slide)) { 875 reset(300); 876 } 877 }); 878 879 // debouncedresize 880 881 $(window).on('debouncedresize', reload); 882 883 } 884 885 if ($('body').hasClass('mobile-side-slide')) { 886 sideSlide(); 887 } 888 889 /** 890 * Gallery | WordPress Gallery 891 */ 892 893 // WordPress <= 4.9 | content 894 895 $('.sections_group .gallery, .elementor-section .gallery').each(function() { 896 897 var el = $(this); 898 var id = el.attr('id'); 899 900 $('> br', el).remove(); 901 902 $('.gallery-icon > a', el) 903 .wrap('<div class="image_frame scale-with-grid"><div class="image_wrapper"></div></div>') 904 .prepend('<div class="mask"></div>') 905 .children('img') 906 .css('height', 'auto') 907 .css('width', '100%'); 908 909 // lightbox | link to media file 910 911 if (el.hasClass('file')) { 912 $('.gallery-icon a', el) 913 .attr('rel', 'prettyphoto[' + id + ']') 914 .attr('data-elementor-lightbox-slideshow', id); // FIX: elementor lightbox gallery 915 } 916 917 // isotope for masonry layout 918 919 if (el.hasClass('masonry')) { 920 921 el.isotope({ 922 itemSelector: '.gallery-item', 923 layoutMode: 'masonry', 924 isOriginLeft: rtl ? false : true 925 }); 926 927 } 928 929 }); 930 931 // WordPress >
931= 5.0 | content 932 933 $('.sections_group .wp-block-gallery').each(function(index) { 934 935 var el = $(this); 936 var link = $('.blocks-gallery-item a', el); 937 938 // lightbox | link to media file 939 940 if ((/\.(gif|jpg|jpeg|png)$/i).test(link.attr('href'))) { 941 link.attr('rel', 'prettyphoto[wp5-gallery-' + index + ']'); 942 } 943 944 }); 945 946 // widgets 947 948 $('.widget_media_gallery .gallery').each(function() { 949 950 var el = $(this); 951 var id = el.attr('id'); 952 953 // lightbox | link to media file 954 955 $('.gallery-icon a', el).attr('rel', 'prettyphoto[widget-' + id + ']'); 956 957 }); 958 959 /** 960 * Lightbox | PrettyPhoto 961 */ 962 963 $('a[rel^="prettyphoto[portfolio]"]').each(function() { 964 965 var el = $(this); 966 var parent = el.closest('.column'); 967 var index = $('.column').index(parent); 968 969 el.attr('rel', 'prettyphoto[portfolio-' + index + ']'); 970 971 }); 972 973 /** 974 * Lightbox | Magnific Popup 975 * with prettyPhoto backward compatibility 976 */ 977 978 function lightbox() { 979 980 var galleries = []; 981 982 // init 983 984 var init = function() { 985 986 if (lightboxAttr) { 987 compatibility(); 988 setType(); 989 constructor(); 990 } 991 992 }; 993 994 // backward compatibility for prettyPhoto 995 996 var compatibility = function() { 997 998 $('a[rel^="prettyphoto"], a.prettyphoto, a[rel^="prettyphoto"]').each(function() { 999 1000 var el = $(this); 1001 var rel = el.attr('rel'); 1002 1003 if (rel) { 1004 rel = rel.replace('prettyphoto', 'lightbox'); 1005 } else { 1006 rel = 'lightbox'; 1007 } 1008 1009 // Visual Composer prettyPhoto 1010 var dataRel = el.attr('data-rel'); 1011 if (dataRel) { 1012 rel = dataRel.replace('prettyPhoto', 'lightbox'); 1013 el.removeAttr('data-rel'); 1014 } 1015 1016 el.removeClass('prettyphoto').attr('rel', rel); 1017 1018 }); 1019 1020 }; 1021 1022 // check if item is a part of gallery 1023 1024 var isGallery = function(rel) { 1025 1026 if (!rel) { 1027 return false; 1028 } 1029 1030 var regExp = /\[(?:.*)\]/; 1031 var gallery = regExp.exec(rel); 1032 1033 if (gallery) { 1034 gallery = gallery[0]; 1035 gallery = gallery.replace('[', '').replace(']', ''); 1036 return gallery; 1037 } 1038 1039 return false; 1040 }; 1041 1042 // set array of names of galleries 1043 1044 var setGallery = function(gallery) { 1045 1046 if (galleries.indexOf(gallery) == -1) { 1047 galleries.push(gallery); 1048 return true; 1049 } 1050 1051 return false; 1052 }; 1053 1054 // get file type by link 1055 1056 var getType = function(src) { 1057 1058 if (src.match(/youtube\.com\/watch/i) || src.match(/youtube\.com\/embed/i) || src.match(/youtu\.be/i)) { 1059 return 'iframe'; 1060 1061 } else if (src.match(/youtube-nocookie\.com/i)) { 1062 return 'iframe'; 1063 1064 } else if (src.match(/vimeo\.com/i)) { 1065 return 'iframe'; 1066 1067 } else if (src.match(/\biframe=true\b/i)) { 1068 return 'ajax'; 1069 1070 } else if (src.match(/\bajax=true\b/i)) { 1071 return 'ajax'; 1072 1073 } else if (src.substr(0, 1) == '#') { 1074 return 'inline'; 1075 1076 } else { 1077 return 'image'; 1078 1079 } 1080 }; 1081 1082 // set file type 1083 1084 var setType = function() { 1085 1086 $('a[rel^="lightbox"]').each(function() { 1087 1088 var el = $(this); 1089 var href = el.attr('href'); 1090 var rel = el.attr('rel'); 1091 1092 if (href) { 1093 1094 // gallery 1095 1096 var gallery = isGallery(rel); 1097 1098 if (gallery) { 1099 el.attr('data-type', 'gallery'); 1100 setGallery(gallery); 1101 return true; 1102 } 1103 1104 el.attr('data-type', getType(href)); 1105 1106 // iframe paremeters 1107 1108 if (getType(href) == 'iframe') { 1109 el.attr('href', href.replace('&rel=0', '')); 1110 } 1111 } 1112 1113 }); 1114 1115 }; 1116 1117 // constructor 1118 1119 var constructor = function() { 1120 1121 var attr = { 1122 autoFocusLast: false, 1123 removalDelay: 160, 1124 image: { 1125 titleSrc: function(item) { 1126 var img = item.el.closest('.image_wrapper, li').find('img').first(); 1127 if (lightboxAttr.title && img.length) { 1128 return img.attr('alt'); 1129 } else { 1130 return false;
1131 } 1132 } 1133 } 1134 }; 1135 1136 // image 1137 1138 $('a[rel^="lightbox"][data-type="image"]').magnificPopup({ 1139 autoFocusLast: attr.autoFocusLast, 1140 removalDelay: attr.removalDelay, 1141 type: 'image', 1142 image: attr.image 1143 }); 1144 1145 // iframe | video 1146 1147 $('a[rel^="lightbox"][data-type="iframe"]').magnificPopup({ 1148 autoFocusLast: attr.autoFocusLast, 1149 removalDelay: attr.removalDelay, 1150 type: 'iframe', 1151 iframe: { 1152 patterns: { 1153 youtube: { 1154 index: 'youtube.com/', 1155 id: 'v=', 1156 src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0' 1157 }, 1158 youtu_be: { 1159 index: 'youtu.be/', 1160 id: '/', 1161 src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0' 1162 }, 1163 nocookie: { 1164 index: 'youtube-nocookie.com/embed/', 1165 id: '/', 1166 src: '//www.youtube-nocookie.com/embed/%id%?autoplay=1&rel=0' 1167 } 1168 } 1169 } 1170 }); 1171 1172 // inline 1173 1174 $('a[rel^="lightbox"][data-type="inline"]').magnificPopup({ 1175 autoFocusLast: attr.autoFocusLast, 1176 type: 'inline', 1177 midClick: true, 1178 callbacks: { 1179 open: function() { 1180 $('.mfp-content').children().addClass('mfp-inline'); 1181 }, 1182 beforeClose: function() { 1183 $('.mfp-content').children().removeClass('mfp-inline'); 1184 } 1185 } 1186 }); 1187 1188 // gallery 1189 1190 for (var i = 0, len = galleries.length; i < len; i++) { 1191 1192 var gallery = '[' + galleries[i] + ']'; 1193 gallery = 'a[rel^="lightbox' + gallery + '"]:visible'; 1194 1195 $(gallery).magnificPopup({ 1196 autoFocusLast: attr.autoFocusLast, 1197 removalDelay: attr.removalDelay, 1198 type: 'image', 1199 image: attr.image, 1200 gallery: { 1201 enabled: true, 1202 tCounter: '<span class="mfp-counter">%curr% / %total%</span>' // markup of counter 1203 } 1204 }); 1205 } 1206 1207 // FIX: disable in Elementor wrapper 1208 1209 $('.elementor a[rel^="lightbox"]:not(.popup-link)').off('click'); 1210 1211 }; 1212 1213 // reload 1214 1215 var reload = function() { 1216 1217 $('a[rel^="lightbox"]').off('click'); 1218 constructor(); 1219 1220 }; 1221 1222 // init 1223 1224 init(); 1225 1226 // isotope:arrange 1227 1228 $(document).on('isotope:arrange', reload); 1229 1230 } 1231 1232 lightbox(); 1233 1234 /** 1235 * Menu | mfnMenu 1236 */ 1237 1238 function mainMenu() { 1239 1240 var mmMobileInitW = mobileInitW; 1241 1242 if ($('body').hasClass('header-simple') || $('#Header_creative.dropdown').length) { 1243 mmMobileInitW = 9999; 1244 } 1245 1246 $('#menu > ul.menu').mfnMenu({ 1247 addLast: true, 1248 arrows: true, 1249 mobileInit: mmMobileInitW, 1250 responsive: mfn.responsive 1251 }); 1252 1253 $('#secondary-menu > ul.secondary-menu').mfnMenu({ 1254 mobileInit: mmMobileInitW, 1255 responsive: mfn.responsive 1256 }); 1257 1258 } 1259 1260 mainMenu(); 1261 1262 /** 1263 * Menu | NOT One Page | .scroll item 1264 * Works with .scroll class 1265 * Since 4.8 replaced with: Page Options > One Page | function: onePageMenu() 1266 */ 1267 1268 function onePageScroll() { 1269 if (!$('body').hasClass('one-page')) { 1270 var menu = $('#menu'); 1271 1272 if (menu.find('li.scroll').length > 1) { 1273 menu.find('li.current-menu-item:not(:first)').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor'); 1274 1275 // menu item click 1276 menu.on('click','a',function() { 1277 $(this).closest('li').siblings('li').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor'); 1278 $(this).closest('li').addClass('current-menu-item'); 1279 }); 1280 } 1281 } 1282 } 1283 onePageScroll(); 1284 1285 /** 1286 * Menu | One Page | Active on Scroll & Click 1287 */ 1288 1289 function onePageMenu() { 1290 if ($('body').hasClass('one-page')) { 1291 1292 var menu = $('#menu'); 1293 1294 // add attr [data-hash] & [data-id] 1295 1296 $('a[href]', menu).each(function() { 1297 1298 var url = $(this).attr('href'); 1299 if (url && url.split('#')[1]) { 1300 1301 // data-hash 1302 var hash = '#' + url.split('#')[1]; 1303 if (hash && $(hash).length) { 1304 // check if element with specified ID exists 1305 $(this).attr('data-hash', hash); 1306 $(hash).attr('data-id', hash); 1307 } 1308 1309 // Visual Composer 1310 var vcHash = '#' + url.split('#')[1]; 1311 var vcClass = '.vc_row.' + url.split('#')[1]; 1312 if (vcClass && $(vcClass).length) { 1313 // check if element with specified Class exists 1314 $(this).attr('data-hash', vcHash); 1315 $(vcClass).attr('data-id', vcHash); 1316 } 1317 1318 } 1319 1320 }); 1321 1322 // active 1323 1324 var hash; 1325 var activeSelector = '.menu > li.current-menu-item, .menu > li.current-menu-parent, .menu > li.current-menu-ancestor, .menu > li.current-page-ancestor, .menu > li.current_page_item, .menu > li.current_page_parent, .menu > li.current_page_ancestor'; 1326 var activeClasses = 'current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor'; 1327 1328 if ($(activeSelector, menu).length) { 1329 1330 // remove duplicated 1331 $(activeSelector, menu) 1332 .not(':first').removeClass(activeClasses); 1333 1334 // remove if 1st link to section & section is not visible 1335 hash = $(activeSelector, menu).find('a[data-hash]').attr('data-hash'); 1336 1337 if (hash) { 1338 hash = '[data-id="' + hash + '"]'; 1339 1340 if ($(hash).length && $(hash).visible(true)) { 1341 // do nothing 1342 } else { 1343 $(activeSelector, menu).removeClass('current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor') 1344 .closest('.menu > li').removeClass('current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor'); 1345 } 1346 } else { 1347 // do nothing 1348 } 1349 1350 } else { 1351 1352 // add to first if none is active 1353 var first = $('.menu:first-child > li:first-child', menu); 1354 var firstA = first.children('a'); 1355 1356 if (firstA.attr('data-hash')) { 1357 hash = firstA.attr('data-hash'); 1358 hash = '[data-id="' + hash + '"]'; 1359 1360 if ($(hash).length && ($(hash).offset().top == adminBarH())) { 1361 first.addClass('current-menu-item'); 1362 } 1363 } 1364 1365 } 1366 1367 // click 1368 1369 $('#menu a[data-hash]').on('click', function(e) { 1370 e.preventDefault(); // only with: body.one-page 1371 1372 // active 1373 1374 menu.find('li').removeClass('current-menu-item'); 1375 $(this) 1376 .closest('li').addClass('current-menu-item') 1377 .closest('.menu > li').addClass('current-menu-item'); 1378 1379 var hash = $(this).attr('data-hash'); 1380 hash = '[data-id="' + hash + '"]'; 1381 1382 // mobile - sticky header - close menu 1383 1384 if ( window.innerWidth < 768 ) { 1385 $('.responsive-menu-toggle').removeClass('active'); 1386 $('#Top_bar #menu').hide(); 1387 } 1388 1389 // offset 1390 1391 var headerFixedAbH = $('.header-fixed.ab-show #Action_bar').innerHeight() || 0; 1392 var tabsHeaderH = $(hash).siblings('.ui-tabs-nav').innerHeight() || 0; 1393 1394 var offset = headerFixedAbH + tabsHeaderH + adminBarH(); 1395 1396 // sticky height 1397 1398 var stickyH = fixStickyHeaderH(); 1399 1400 // FIX | Header below | 1st section 1401 if ($('body').hasClass('header-below') && $('#Content').length) { 1402 if ($(hash).offset().top < ($('#Content').offset().top + 60)) { 1403 stickyH = -1; 1404 } 1405 } 1406 1407 // animate scroll 1408 1409 $('html, body').animate({
1410 scrollTop: $(hash).offset().top - offset - stickyH 1411 }, 500); 1412 1413 }); 1414 1415 } 1416 } 1417 onePageMenu(); 1418 1419 /** 1420 * Header | Creative 1421 */ 1422 1423 var cHeader = 'body:not( .header-open ) #Header_creative', 1424 cHeaderEl = $(cHeader), 1425 cHeaderCurrnet; 1426 1427 function creativeHeader() { 1428 1429 $('.creative-menu-toggle').on('click', function(e) { 1430 e.preventDefault(); 1431 1432 cHeaderEl.addClass('active'); 1433 $('.creative-menu-toggle, .creative-social', cHeaderEl).fadeOut(500); 1434 $('#Action_bar', cHeaderEl).fadeIn(500); 1435 1436 }); 1437 1438 } 1439 creativeHeader(); 1440 1441 $(document).on('mouseenter', cHeader, function() { 1442 cHeaderCurrnet = 1; 1443 }); 1444 1445 $(document).on('mouseleave', cHeader, function() { 1446 cHeaderCurrnet = null; 1447 setTimeout(function() { 1448 if (!cHeaderCurrnet) { 1449 1450 cHeaderEl.removeClass('active'); 1451 $('.creative-menu-toggle, .creative-social', cHeaderEl).fadeIn(500); 1452 $('#Action_bar', cHeaderEl).fadeOut(500); 1453 1454 } 1455 }, 1000); 1456 }); 1457 1458 // Fix: Header Creative & Mobile Sticky | On Resize > 768 px 1459 function creativeHeaderFix() { 1460 if ( $('body').hasClass('header-creative') && window.innerWidth >= 768 ) { 1461 if ($('#Top_bar').hasClass('is-sticky')) { 1462 $('#Top_bar').removeClass('is-sticky'); 1463 } 1464 } 1465 } 1466 1467 /** 1468 * Header | Search 1469 */ 1470 1471 $("#search_button:not(.has-input), #Top_bar .icon_close").on('click', function(e) { 1472 e.preventDefault(); 1473 $('#Top_bar .search_wrapper').fadeToggle() 1474 .find('.field').focus(); 1475 }); 1476 1477 /** 1478 * WPML | Language switcher in the WP Menu 1479 */ 1480 1481 function mfnWPML() { 1482 $('#menu .menu-item-language:not(.menu-item-language-current)').each(function() { 1483 var el = $(this).children('a'); 1484 1485 if (!el.children('span:not(.icl_lang_sel_bracket)').length) { 1486 el.wrapInner('<span></span>'); 1487 } 1488 1489 }); 1490 1491 $('#menu span.icl_lang_sel_bracket').each(function() { 1492 var el = $(this); 1493 el.replaceWith(el.html()); 1494 }); 1495 1496 } 1497 mfnWPML(); 1498 1499 /** 1500 * Breadcrumbs | Remove last item link 1501 */ 1502 1503 function breadcrumbsRemoveLastLink() { 1504 var el = $('.breadcrumbs.no-link').find('li').last(); 1505 var text = el.text(); 1506 el.html(text); 1507 } 1508 breadcrumbsRemoveLastLink(); 1509 1510 /** 1511 * Downcount 1512 */ 1513 1514 $('.downcount').each(function() { 1515 var el = $(this); 1516 el.downCount({ 1517 date: el.attr('data-date'), 1518 offset: el.attr('data-offset') 1519 }); 1520 }); 1521 1522 /** 1523 * Hover | on Touch | .tooltip, .hover_box 1524 */ 1525 1526 $('.tooltip, .hover_box') 1527 .on('touchstart', function() { 1528 $(this).toggleClass('hover'); 1529 }) 1530 .on('touchend', function() { 1531 $(this).removeClass('hover'); 1532 }); 1533 1534 /** 1535 * Popup | Contact Form | Button 1536 */ 1537 1538 $("#popup_contact .footer_button").on('click', function(e) { 1539 e.preventDefault(); 1540 $(this).parent().toggleClass('focus'); 1541 }); 1542 1543 /** 1544 * Scroll | niceScroll for Header Creative 1545 */ 1546 1547 if ( ('#Header_creative.scroll').length && window.innerWidth >= 1240 ) { 1548 $('#Header_creative.scroll').niceScroll({ 1549 autohidemode: false, 1550 cursorborder: 0, 1551 cursorborderradius: 5, 1552 cursorcolor: '#222222', 1553 cursorwidth: 0, 1554 horizrailenabled: false, 1555 mousescrollstep: 40, 1556 scrollspeed: 60 1557 }); 1558 } 1559 1560 /** 1561 * Sliding Top 1562 */ 1563 1564 $('.sliding-top-control').on('click', function(e) { 1565 e.preventDefault(); 1566 $('#Sliding-top .widgets_wrapper').slideToggle(); 1567 $('#Sliding-top').toggleClass('active'); 1568 }); 1569 1570 /** 1571 * Alert 1572 */ 1573 1574 $('body').on('click', '.alert .close', function(e) { 1575 e.preventDefault(); 1576 $(this).closest('.alert').hide(300); 1577 }); 1578 1579 /** 1580 * Navigation Arrows | Sticky 1581 */ 1582 1583 $('.fixed-nav').appendTo('body'); 1584 1585 /** 1586 * Feature List 1587 */ 1588 1589 $('.feature_list').each(function() { 1590 var col = $(this).attr('data-col') ? $(this).attr('data-col') : 4;
1591 $(this).find('li:nth-child(' + col + 'n):not(:last-child)').after('<hr />'); 1592 }); 1593 1594 /** 1595 * IE Fixes 1596 */ 1597 1598 function checkIE() { 1599 // IE 9 1600 var ua = window.navigator.userAgent; 1601 var msie = ua.indexOf("MSIE "); 1602 if (msie > 0 && parseInt(ua.substring(msie + 5, ua.indexOf(".", msie))) == 9) { 1603 $("body").addClass("ie"); 1604 } 1605 } 1606 checkIE(); 1607 1608 /** 1609 * Parallax 1610 */ 1611 1612 var ua = navigator.userAgent, 1613 isMobileWebkit = /WebKit/.test(ua) && /Mobile/.test(ua); 1614 1615 if ( ! isMobileWebkit && window.innerWidth >= 768 ) { 1616 1617 if (mfn.parallax == 'stellar') { 1618 1619 // Stellar 1620 $.stellar({ 1621 horizontalScrolling: false, 1622 responsive: true 1623 }); 1624 1625 } else { 1626 1627 // Enllax 1628 $(window).enllax(); 1629 1630 } 1631 1632 } else { 1633 1634 $('div[data-enllax-ratio], div[data-stellar-ratio]').css('background-attachment', 'scroll'); 1635 1636 } 1637 1638 /** 1639 * Load More | Ajax 1640 */ 1641 1642 $('.pager_load_more').on('click', function(e) { 1643 e.preventDefault(); 1644 1645 var el = $(this); 1646 var pager = el.closest('.pager_lm'); 1647 var href = el.attr('href'); 1648 1649 // index | for many items on the page 1650 var index = $('.lm_wrapper').index(el.closest('.isotope_wrapper').find('.lm_wrapper')); 1651 1652 el.fadeOut(50); 1653 pager.addClass('loading'); 1654 1655 $.get( href, function( data ) { 1656 1657 // content 1658 1659 var content = $('.lm_wrapper:eq(' + index + ')', data).wrapInner('').html(); 1660 var $content = $(content); 1661 1662 if ($('.lm_wrapper:eq(' + index + ')').hasClass('isotope')) { 1663 1664 // isotope 1665 $('.lm_wrapper:eq(' + index + ')').append( $content ).isotope('appended', $content); 1666 1667 } else { 1668 1669 // default 1670 $content.hide().appendTo('.lm_wrapper:eq(' + index + ')').fadeIn(1000); 1671 1672 } 1673 1674 // next page link 1675 1676 href = $('.lm_wrapper:eq(' + index + ')', data).next().find('.pager_load_more').attr('href'); 1677 pager.removeClass('loading'); 1678 if (href) { 1679 el.fadeIn(); 1680 el.attr('href', href); 1681 } 1682 1683 // refresh some staff 1684 1685 mfnJPlayer(); 1686 lightbox(); 1687 1688 // isotope fix: second resize 1689 1690 $('.lm_wrapper.isotope').imagesLoaded().progress(function() { 1691 $('.lm_wrapper.isotope').isotope(); 1692 }); 1693 1694 }); 1695 1696 }); 1697 1698 /** 1699 * Filters | Blog & Portfolio 1700 */ 1701 1702 $('.filters_buttons .open').on('click', function(e) { 1703 e.preventDefault(); 1704 var type = $(this).closest('li').attr('class'); 1705 1706 $('.filters_wrapper').show(200); 1707 $('.filters_wrapper ul.' + type).show(200); 1708 $('.filters_wrapper ul:not(.' + type + ')').hide(); 1709 }); 1710 1711 $('.filters_wrapper .close a').on('click', function(e) { 1712 e.preventDefault(); 1713 $('.filters_wrapper').hide(200); 1714 }); 1715 1716 /** 1717 * Portfolio List | Next v / Prev ^ buttons 1718 */ 1719 1720 $('.portfolio_next_js').on('click', function(e) { 1721 e.preventDefault(); 1722 1723 var item = $(this).closest('.portfolio-item').next(); 1724 1725 if (item.length) { 1726 $('html, body').animate({ 1727 scrollTop: item.offset().top - fixStickyHeaderH() 1728 }, 500); 1729 } 1730 }); 1731 1732 $('.portfolio_prev_js').on('click', function(e) { 1733 e.preventDefault(); 1734 1735 var item = $(this).closest('.portfolio-item').prev(); 1736 1737 if (item.length) { 1738 $('html, body').animate({ 1739 scrollTop: item.offset().top - fixStickyHeaderH() 1740 }, 500); 1741 } 1742 }); 1743 1744 /** 1745 * Link | Smooth Scroll | .scroll 1746 */ 1747 1748 $('.scroll > a, a.scroll').on('click', function(e) { 1749 1750 // prevent default if link directs to the current page 1751 1752 var urlL = location.href.replace(/\/#.*|#.*/, ''); 1753 var urlT = this.href.replace(/\/#.*|#.*/, ''); 1754 1755 if (urlL == urlT) { 1756 e.preventDefault(); 1757 } 1758 1759 var hash = this.hash; 1760 1761 // offset 1762 1763 var headerFixedAbH = $('.header-fixed.ab-show #Action_bar').innerHeight() || 0; 1764 var tabsHeaderH = $(hash).siblings('.ui-tabs-nav').innerHeight() || 0; 1765 1766 var offset = headerFixedAbH + tabsHeaderH + adminBarH(); 1767 1768 // animate scroll 1769 1770 if (hash && $(hash).length) { 1771 1772 $('html, body').animate({
1773 scrollTop: $(hash).offset().top - offset - fixStickyHeaderH() 1774 }, 500); 1775 } 1776 }); 1777 1778 /** 1779 * Tabs 1780 */ 1781 1782 $('.jq-tabs').tabs(); 1783 1784 /** 1785 * Accordion & FAQ 1786 */ 1787 1788 $('.mfn-acc').each(function() { 1789 var el = $(this); 1790 1791 if (el.hasClass('openAll')) { 1792 1793 // show all 1794 el.find('.question') 1795 .addClass("active") 1796 .children(".answer") 1797 .show(); 1798 1799 } else { 1800 1801 // show one 1802 var activeTab = el.attr('data-active-tab'); 1803 if (el.hasClass('open1st')) activeTab = 1; 1804 1805 if (activeTab) { 1806 el.find('.question').eq(activeTab - 1) 1807 .addClass("active") 1808 .children(".answer") 1809 .show(); 1810 } 1811 1812 } 1813 }); 1814 1815 $('.mfn-acc .question > .title').on('click', function() { 1816 1817 if ($(this).parent().hasClass("active")) { 1818 1819 $(this).parent().removeClass("active").children(".answer").slideToggle(100); 1820 1821 } else { 1822 1823 if (!$(this).closest('.mfn-acc').hasClass('toggle')) { 1824 $(this).parents(".mfn-acc").children().each(function() { 1825 if ($(this).hasClass("active")) { 1826 $(this).removeClass("active").children(".answer").slideToggle(100); 1827 } 1828 }); 1829 } 1830 $(this).parent().addClass("active"); 1831 $(this).next(".answer").slideToggle(100); 1832 1833 } 1834 1835 setTimeout(function() { 1836 $(window).trigger('resize'); 1837 }, 50); 1838 1839 }); 1840 1841 // Visual Composer | Accordion | Sidebar height 1842 $('.wpb_wrapper .vc_tta-panel-title').on('click', 'a', function() { 1843 1844 setTimeout(function() { 1845 $(window).trigger('resize'); 1846 }, 50); 1847 1848 }); 1849 1850 /** 1851 * Helper 1852 */ 1853 1854 $('.helper .link.toggle').on('click', function(e) { 1855 1856 e.preventDefault(); 1857 1858 var el = $(this); 1859 var id = el.attr('data-rel'); 1860 var parent = el.closest('.helper'); 1861 1862 if (el.hasClass('active')) { 1863 1864 el.removeClass('active'); 1865 parent.find('.helper_content > .item-' + id).removeClass('active').slideUp(200); 1866 1867 } else { 1868 1869 parent.find('.links > .link.active').removeClass('active'); 1870 parent.find('.helper_content > .item.active').slideUp(200); 1871 1872 el.addClass('active'); 1873 parent.find('.helper_content > .item-' + id).addClass('active').slideDown(200); 1874 1875 } 1876 1877 setTimeout(function() { 1878 $(window).trigger('resize'); 1879 }, 50); 1880 1881 }); 1882 1883 /** 1884 * HTML5 Video | jPlayer 1885 */ 1886 1887 function mfnJPlayer() { 1888 $('.mfn-jplayer').each(function() { 1889 1890 var m4v = $(this).attr('data-m4v'), 1891 poster = $(this).attr('data-img'), 1892 swfPath = $(this).attr('data-swf'), 1893 cssSelectorAncestor = '#' + $(this).closest('.mfn-jcontainer').attr('id'); 1894 1895 $(this).jPlayer({ 1896 ready: function() { 1897 $(this).jPlayer('setMedia', { 1898 m4v: m4v, 1899 poster: poster 1900 }); 1901 }, 1902 play: function() { 1903 // To avoid both jPlayers playing together. 1904 $(this).jPlayer('pauseOthers'); 1905 }, 1906 size: { 1907 cssClass: 'jp-video-360p', 1908 width: '100%', 1909 height: '360px' 1910 }, 1911 swfPath: swfPath, 1912 supplied: 'm4v', 1913 cssSelectorAncestor: cssSelectorAncestor, 1914 wmode: 'opaque' 1915 }); 1916 }); 1917 } 1918 mfnJPlayer(); 1919 1920 /** 1921 * Love 1922 */ 1923 1924 $('.mfn-love').on('click', function() { 1925 var el = $(this); 1926 1927 if (el.hasClass('loved')) { 1928 return false; 1929 } 1930 el.addClass('loved'); 1931 1932 var post = { 1933 action: 'mfn_love', 1934 post_id: el.attr('data-id') 1935 }; 1936 1937 $.post(mfn.ajax, post, function(data) { 1938 el.find('.label').html(data); 1939 }); 1940 1941 return false; 1942 }); 1943 1944 /** 1945 * Go to top 1946 */ 1947 1948 $('#back_to_top').on('click', function() { 1949 $('body,html').animate({ 1950 scrollTop: 0 1951 }, 500); 1952 return false; 1953 }); 1954 1955 /** 1956 * Section | Next v / Prev ^ arrows 1957 */ 1958 1959 $('.section .section-nav').on('click', function() { 1960 1961 var el = $(this); 1962 var section = el.closest('.section'); 1963 1964 if (el.hasClass('prev')) { 1965 1966 // Previous Section 1967 if (section.prev().length) { 1968 $('html, body').animate({ 1969 scrollTop: section.prev().offset().top 1970 }, 500); 1971 } 1972 1973 } else { 1974 1975 // Next Section 1976 if (section.next().length) { 1977 $('html, body').animate({ 1978 scrollTop: section.next().offset().top 1979 }, 500); 1980 } 1981 1982 } 1983 }); 1984 1985 /** 1986 * Intro | Scroll v arrow 1987 */ 1988 1989 $('#Intro .intro-next').on('click', function() { 1990 var intro = $(this).closest('#Intro'); 1991 1992 if (intro.next().length) { 1993 $('html, body').animate({ 1994 scrollTop: intro.next().offset().top - fixStickyHeaderH() - adminBarH() 1995 }, 500); 1996 } 1997 }); 1998 1999 /** 2000 * Widget | Muffin Menu | Hover on click 2001 */ 2002 2003 $('.widget_mfn_menu ul.submenus-click').each(function() { 2004 2005 var el = $(this); 2006 2007 $('a', el).on('click', function(e) { 2008 var li = $(this).closest('li'); 2009 2010 if (li.hasClass('hover') || !li.hasClass('menu-item-has-children')) { 2011 // link click 2012 } else { 2013 e.preventDefault(); 2014 li.siblings('li').removeClass('hover') 2015 .find('li').removeClass('hover'); 2016 $(this).closest('li').addClass('hover'); 2017 } 2018 2019 }); 2020 2021 }); 2022 2023 /** 2024 * WooCommerce | Add to cart 2025 */ 2026 2027 function addToCart() { 2028 2029 $('body').on('click', '.add_to_cart_button', function() { 2030 $(this) 2031 .closest('.product') 2032 .addClass('adding-to-cart') 2033 .removeClass('added-to-cart'); 2034 }); 2035 2036 $('body').on('added_to_cart', function() { 2037 $('.adding-to-cart') 2038 .removeClass('adding-to-cart') 2039 .addClass('added-to-cart'); 2040 }); 2041 } 2042 addToCart(); 2043 2044 /** 2045 * WooCommerce | Rating click 2046 */ 2047 2048 $('.woocommerce-product-rating').on('click', function(){ 2049 2050 var el; 2051 2052 if( $('.woocommerce-content .jq-tabs').length ){ 2053 2054 el = $('.woocommerce-content .jq-tabs'); 2055 $('.ui-tabs-nav a[href="#tab-reviews"]', el).trigger('click'); 2056 2057 } else { 2058 2059 el = $('.woocommerce-content .accordion'); 2060 $('#reviews').closest('.question:not(.active)').children('.title').trigger('click'); 2061 2062 } 2063 2064 // offset 2065 2066 var actionBarH = $('.header-fixed.ab-show #Action_bar').innerHeight() || 0; 2067 var offset = actionBarH + adminBarH(); 2068 2069 // animate scroll 2070 2071 $('html, body').animate({ 2072 scrollTop: el.offset().top - offset - fixStickyHeaderH() 2073 }, 500); 2074 2075 }); 2076 2077 /** 2078 * Ajax | Complete 2079 */ 2080 2081 $(document).ajaxComplete(function() { 2082 2083 setTimeout(function() { 2084 $(window).trigger('resize'); 2085 }, 100); 2086 2087 }); 2088 2089 /** 2090 * Isotope 2091 */ 2092 2093 // Isotope | Fiters 2094
2095 function isotopeFilter(domEl, isoWrapper) { 2096 2097 var filter = domEl.attr('data-rel'); 2098 2099 isoWrapper.isotope({ 2100 filter: filter 2101 }); 2102 2103 setTimeout(function() { 2104 $(window).trigger('resize'); 2105 }, 50); 2106 2107 } 2108 2109 // Isotope | Fiters | Click ---------- 2110 2111 $('.isotope-filters .filters_wrapper').find('li:not(.close) a').on('click', function(e) { 2112 e.preventDefault(); 2113 2114 var isoWrapper = $('.isotope'), 2115 filters = $(this).closest('.isotope-filters'), 2116 parent = filters.attr('data-parent'); 2117 2118 if (parent) { 2119 parent = filters.closest('.' + parent); 2120 isoWrapper = parent.find('.isotope').first(); 2121 } 2122 2123 filters.find('li').removeClass('current-cat'); 2124 $(this).closest('li').addClass('current-cat'); 2125 2126 isotopeFilter($(this), isoWrapper); 2127 2128 setTimeout(function() { 2129 $(document).trigger('isotope:arrange'); 2130 }, 500); 2131 }); 2132 2133 // Isotope | Fiters | Reset 2134 2135 $('.isotope-filters .filters_buttons').find('li.reset a').on('click', function(e) { 2136 e.preventDefault(); 2137 2138 $('.isotope-filters .filters_wrapper').find('li').removeClass('current-cat'); 2139 isotopeFilter($(this), $('.isotope')); 2140 }); 2141 2142 /** 2143 * $(window).on('debouncedresize') 2144 * Specify a function to execute on window resize 2145 */ 2146 2147 $(window).on('debouncedresize', function() { 2148 2149 // isotope 2150 2151 $('.masonry.isotope, .masonry.gallery').isotope(); 2152 2153 // sliding footer height 2154 2155 mfnFooter(); 2156 2157 // header width 2158 2159 headerWidth(); 2160 2161 // sidebar height 2162 2163 mfnSidebar(); 2164 2165 // full screen sections 2166 2167 // ! visual builder 2168 if( ! $('body').hasClass('mfn-ui') ){ 2169 mfnSectionH(); 2170 } 2171 2172 // intro header 2173 2174 mfnIntroH(); 2175 2176 // equal height 2177 2178 mfnEqualHeightWrap(); 2179 mfnEqualHeight(); 2180 2181 // mobile sticky for header creative 2182 2183 creativeHeaderFix(); 2184 2185 }); 2186 2187 /** 2188 * document.ready 2189 * Initialize document ready functions 2190 */ 2191 2192 mfnSliderBlog(); 2193 mfnSliderClients(); 2194 mfnSliderOffer(); 2195 mfnSliderOfferThumb(); 2196 mfnSliderShop(); 2197 2198 sliderPortfolio(); 2199 sliderTestimonials(); 2200 2201 // sliding footer height 2202 2203 mfnFooter(); 2204 2205 // header width 2206 2207 headerWidth(); 2208 2209 // sidebar height 2210 2211 mfnSidebar(); 2212 2213 // full screen sections 2214 2215 mfnSectionH(); 2216 2217 // intro header 2218 2219 mfnIntroH(); 2220 2221 // equal height 2222 2223 mfnEqualHeightWrap(); 2224 mfnEqualHeight(); 2225 2226 // hash navigation 2227 2228 hashNav(); 2229 2230 }); 2231 2232 /** 2233 * $(window).on('scroll') 2234 * The scroll event is sent to an element when the user scrolls to a different place in the element. 2235 */ 2236 2237 $(window).on('scroll', function() { 2238 2239 // sticky header 2240 2241 mfnSticky(); 2242 mfnMobileSticky(); 2243 2244 // sticky back to top 2245 2246 backToTopSticky(); 2247 2248 // one page scroll active 2249 2250 onePageActive(); 2251 2252 }); 2253 2254 /** 2255 * $(window).on('load') 2256 * window.load 2257 */ 2258 2259 $(window).on('load', function() { 2260 2261 /** 2262 * Elementor plugin 2263 * Disable built-in one page 2264 */ 2265 2266 function elementorDisableOnePage(){ 2267 2268 if( ! $('body').hasClass('one-page') ){ 2269 return false; 2270 } 2271 2272 setTimeout(function(){ 2273 var doc=$(document), 2274 $events=$("a[href*='#']").length ? $._data(doc[0],"events") : null; 2275 if($events && $events.click){ 2276 for(var i=$events.click.length-1; i>=0; i--){ 2277 var handler=$events.click[i]; 2278 if(handler && handler.namespace != "mPS2id" && handler.selector === 'a[href*="#"]' ) doc.off("click",handler.handler); 2279 } 2280 } 2281 }, 300); 2282 2283 } 2284 2285 elementorDisableOnePage(); 2286 2287 /** 2288 * Retina Logo 2289 */ 2290 2291 function retinaLogo() { 2292 2293 // ! retina display 2294 2295 if( window.devicePixelRatio <= 1 ){ 2296 return false; 2297 } 2298 2299 var el, src, height, 2300 parent = $('#Top_bar #logo'), 2301 parentH = parent.data('height'); 2302 2303 var maxH = { 2304 sticky: { 2305 init: 35, 2306 noPadding: 60, 2307 overflow: 110 2308 }, 2309 mobile: { 2310 mini: 50, 2311 miniNoPadding: 60 2312 }, 2313 mobileSticky: { 2314 init: 50, 2315 noPadding: 60, 2316 overflow: 80 2317 } 2318 }; 2319 2320 $('#Top_bar #logo img').each(function(index) { 2321 2322 el = $(this); 2323 src = el.data('retina'); 2324 height = el.height() || 0; 2325 2326 // main 2327 2328 if (el.hasClass('logo-main')) { 2329 2330 if ($('body').hasClass('logo-overflow')) { 2331 2332 // do nothing 2333 2334 } else if (height > parentH) { 2335 2336 height = parentH; 2337 2338 } 2339 2340 } 2341 2342 // sticky 2343 2344 if (el.hasClass('logo-sticky')) { 2345 2346 if ($('body').hasClass('logo-overflow')) { 2347 2348 if (height > maxH.sticky.overflow) { 2349 height = maxH.sticky.overflow; 2350 } 2351 2352 } else if ($('body').hasClass('logo-no-sticky-padding')) { 2353 2354 if (height > maxH.sticky.noPadding) { 2355 height = maxH.sticky.noPadding; 2356 } 2357 2358 } else if (height > maxH.sticky.init) { 2359 2360 height = maxH.sticky.init; 2361 2362 } 2363 2364 } 2365 2366 // mobile 2367 2368 if (el.hasClass('logo-mobile')) { 2369 2370 if ($('body').hasClass('mobile-header-mini')) { 2371 2372 if (parent.data('padding') > 0) { 2373 2374 if (height > maxH.mobile.mini) { 2375 height = maxH.mobile.mini; 2376 } 2377 2378 } else { 2379 2380 if (height > maxH.mobile.miniNoPadding) { 2381 height = maxH.mobile.miniNoPadding; 2382 } 2383 2384 } 2385 2386 } 2387 2388 } 2389 2390 // mobile-sticky 2391 2392 if (el.hasClass('logo-mobile-sticky')) { 2393 2394 if ($('body').hasClass('logo-no-sticky-padding')) { 2395 2396 if (height > maxH.mobileSticky.noPadding) { 2397 height = maxH.mobileSticky.noPadding; 2398 } 2399 2400 } else if (height > maxH.mobileSticky.init) { 2401 height = maxH.mobileSticky.init; 2402 } 2403 2404 } 2405 2406 // SET 2407 2408 if (src) { 2409 el.parent().addClass('retina'); 2410 el.attr('src', src).css('max-height', height + 'px'); 2411 } 2412 2413 }); 2414 2415 } 2416 2417 setTimeout(function() { 2418 retinaLogo(); 2419 }, 0); // jQuery 3.5 window.load 2420 2421 /** 2422 * Isotope 2423 */ 2424 2425 // Portfolio - Isotope 2426 2427 $('.blog_wrapper .isotope:not( .masonry ), .portfolio_wrapper .isotope:not( .masonry-flat, .masonry-hover, .masonry-minimal )').isotope({ 2428 itemSelector: '.isotope-item', 2429 layoutMode: 'fitRows', 2430 isOriginLeft: rtl ? false : true 2431 }); 2432 2433 // Portfolio - Masonry Flat 2434 2435 $('.portfolio_wrapper .masonry-flat').isotope({ 2436 itemSelector: '.isotope-item', 2437 percentPosition: true, 2438 masonry: { 2439 columnWidth: 1 2440 }, 2441 isOriginLeft: rtl ? false : true 2442 }); 2443 2444 // Blog & Portfolio - Masonry 2445 2446 $('.isotope.masonry, .isotope.masonry-hover, .isotope.masonry-minimal').isotope({ 2447 itemSelector: '.isotope-item', 2448 layoutMode: 'masonry', 2449 isOriginLeft: rtl ? false : true 2450 }); 2451 2452 // Portfolio | Active Category 2453 2454 function portfolioActive() { 2455 2456 var el = $('.isotope-filters .filters_wrapper'); 2457 var active = el.attr('data-cat'); 2458 2459 if (active) { 2460 el.find('li.' + active).addClass('current-cat'); 2461 $('.isotope').isotope({ 2462 filter: '.category-' + active 2463 }); 2464 } 2465 2466 } 2467 2468 portfolioActive(); 2469 2470 /** 2471 * Chart 2472 */ 2473 // visual builder 2474 $('.sections_group .chart, .elementor-section .chart').waypoint({ 2475 2476 offset: '100%', 2477 triggerOnce: true, 2478 handler: function(){ 2479 2480 var el = $(this.element).length ? $(this.element) : $(this); 2481 var lineW = simple ? 4 : 8; 2482 2483 el.easyPieChart({ 2484 animate: 1000, 2485 lineCap: 'circle', 2486 lineWidth: lineW, 2487 size: 140, 2488 scaleColor: false 2489 }); 2490 2491 if (typeof this.destroy !== 'undefined' && $.isFunction(this.destroy)) { 2492 this.destroy(); 2493 } 2494 } 2495 2496 }); 2497 2498 /** 2499 * Skills 2500 */ 2501 2502 $('.bars_list').waypoint({ 2503 2504 offset: '100%', 2505 triggerOnce: true, 2506 handler: function() { 2507 2508 var el = $(this.element).length ? $(this.element) : $(this); 2509 2510 el.addClass('hover'); 2511 2512 if (typeof this.destroy !== 'undefined' && $.isFunction(this.destroy)) { 2513 this.destroy(); 2514 } 2515 } 2516 2517 }); 2518 2519 /** 2520 * Progress Icons 2521 */ 2522 2523 $('.progress_icons').waypoint({ 2524 2525 offset: '100%', 2526 triggerOnce: true, 2527 handler: function() { 2528 2529 var el = $(this.element).length ? $(this.element) : $(this); 2530 var active = el.attr('data-active'); 2531 var color = el.attr('data-color'); 2532 var icon = el.find('.progress_icon'); 2533 var timeout = 200; // timeout in milliseconds 2534 2535 icon.each(function(i) { 2536 if (i < active) { 2537 var time = (i + 1) * timeout; 2538 setTimeout(function() { 2539 $(icon[i]) 2540 .addClass('themebg') 2541 .css('background-color', color); 2542 }, time); 2543 } 2544 }); 2545 2546 if (typeof this.destroy !== 'undefined' && $.isFunction(this.destroy)) { 2547 this.destroy(); 2548 } 2549 } 2550 2551 }); 2552 2553 /** 2554 * Animate Math | Counter, Quick Fact, etc. 2555 */ 2556 2557 $('.animate-math .number').waypoint({ 2558 2559 offset: '100%', 2560 triggerOnce: true, 2561 handler: function() { 2562 2563 var el = $(this.element).length ? $(this.element) : $(this); 2564 var duration = Math.floor((Math.random() * 1000) + 1000); 2565 var to = el.attr('data-to'); 2566 2567 $({ 2568 property: 0 2569 }).animate({ 2570 property: to 2571 }, { 2572 duration: duration, 2573 easing: 'linear', 2574 step: function() { 2575 el.text(Math.floor(this.property)); 2576 }, 2577 complete: function() { 2578 el.text(this.property); 2579 } 2580 }); 2581 2582 if (typeof this.destroy !== 'undefined' && $.isFunction(this.destroy)) { 2583 this.destroy(); 2584 } 2585 } 2586 2587 }); 2588 2589 /** 2590 * Before After | TwentyTwenty 2591 */ 2592 2593 $('.before_after.twentytwenty-container').twentytwenty(); 2594 2595 // Visual Composer prettyPhoto | off 2596 2597 if ( lightboxAttr ) { 2598 $('a[data-rel^="prettyPhoto"], a[rel^="lightbox"]').each(function() { 2599 $(this).off('click.prettyphoto'); 2600 }); 2601 } 2602 2603 /** 2604 * Reload some functions on window.load 2605 */ 2606 2607 // sticky header 2608 2609 mfnStickyH(); 2610 mfnSticky(); 2611 mfnMobileSticky(); 2612 2613 // full screen sections 2614 2615 mfnSectionH(); 2616 2617 // hash navigation 2618 2619 hashNav(); 2620 2621 // intro header 2622 2623 mfnIntroH(); 2624 2625 // FIX | jQuery 3.5 window.load 2626 2627 setTimeout(function() { 2628
2629 // triger resize to recalculate some plugins stuff 2630 2631 $(window).trigger('resize'); 2632 2633 // sidebar height 2634 2635 mfnSidebar(); 2636 2637 // sliders 2638 2639 sliderSlider(); 2640 2641 // isotope 2642 2643 $('.isotope').isotope(); 2644 2645 }, 0); 2646 2647 }); 2648 2649 /** 2650 * $(document).on('mouseup') 2651 * Specify a function to execute when the DOM is fully loaded. 2652 */ 2653 2654 $(document).on('mouseup',function(e) { 2655 2656 // Widget | Muffin Menu | Hover on click 2657 2658 if ($('.widget_mfn_menu ul.submenus-click').length && ($('.widget_mfn_menu ul.submenus-click').has(e.target).length === 0) ) { 2659 $('.widget_mfn_menu ul.submenus-click li').removeClass('hover'); 2660 } 2661 2662 // Mobile Menu | Classic | Close on click outside menu 2663 2664 if ($('.menu_wrapper').length && ( $('.menu_wrapper').has(e.target).length === 0 )) { 2665 if( $('.responsive-menu-toggle').hasClass('active') ){ 2666 $('.responsive-menu-toggle').trigger('click'); 2667 } 2668 } 2669 2670 }); 2671 2672 /** 2673 * Sliders configuration 2674 */ 2675 2676 // Slick Slider | Auto responsive 2677 2678 function slickAutoResponsive(slider, max, size) { 2679 2680 if (!max){ 2681 max = 5; 2682 } 2683 if (!size){ 2684 size = 380; 2685 } 2686 2687 var width = slider.width() || 0, 2688 count = Math.ceil(width / size); 2689 2690 if (count < 1) count = 1; 2691 if (count > max) count = max; 2692 2693 return count; 2694 } 2695 2696 // Slider | Offer Thumb 2697 2698 function mfnSliderOfferThumb() { 2699 2700 var pager = function(el, i) { 2701 var img = $(el.$slides[i]).find('.thumbnail:first').html(); 2702 return '<a>' + img + '</a>'; 2703 }; 2704 2705 $('.offer_thumb_ul').each(function() { 2706 2707 var slider = $(this); 2708 2709 slider.slick({ 2710 cssEase: 'ease-out', 2711 arrows: false, 2712 dots: true, 2713 infinite: true, 2714 touchThreshold: 10, 2715 speed: 300, 2716 2717 adaptiveHeight: true, 2718 appendDots: slider.siblings('.slider_pagination'), 2719 customPaging: pager, 2720 2721 rtl: rtl ? true : false, 2722 autoplay: mfn.slider.offer ? true : false, 2723 autoplaySpeed: mfn.slider.offer ? mfn.slider.offer : 5000, 2724 2725 slidesToShow: 1, 2726 slidesToScroll: 1 2727 }); 2728 2729 }); 2730 } 2731 2732 // Slider | Offer 2733 2734 function mfnSliderOffer() { 2735 $('.offer_ul').each(function() { 2736 2737 var slider = $(this); 2738 2739 slider.slick({ 2740 cssEase: 'ease-out', 2741 dots: false, 2742 infinite: true, 2743 touchThreshold: 10, 2744 speed: 300, 2745 2746 prevArrow: '<a class="slider_prev" href="#"><span class="button_icon"><i class="icon-up-open-big"></i></span></a>', 2747 nextArrow: '<a class="slider_next" href="#"><span class="button_icon"><i class="icon-down-open-big"></i></span></a>', 2748 2749 adaptiveHeight: true, 2750 //customPaging : pager, 2751 2752 rtl: rtl ? true : false, 2753 autoplay: mfn.slider.offer ? true : false, 2754 autoplaySpeed: mfn.slider.offer ? mfn.slider.offer : 5000, 2755 2756 slidesToShow: 1, 2757 slidesToScroll: 1 2758 }); 2759 2760 // Pagination | Show (css) 2761 2762 slider.siblings('.slider_pagination').addClass('show'); 2763 2764 // Pager | Set slide number after change 2765 2766 slider.on('afterChange', function(event, slick, currentSlide, nextSlide) { 2767 slider.siblings('.slider_pagination').find('.current').text(currentSlide + 1); 2768 }); 2769 2770 }); 2771 } 2772 2773 // Slider | Shop 2774 2775 function mfnSliderShop() { 2776 2777 var pager = function(el, i) { 2778 return '<a>' + i + '</a>'; 2779 }; 2780 2781 $('.shop_slider_ul').each(function() { 2782 2783 var slider = $(this); 2784 var slidesToShow = 4; 2785 2786 var count = slider.closest('.shop_slider').data('count'); 2787 if (slidesToShow > count) { 2788 slidesToShow = count; 2789 if (slidesToShow < 1) { 2790 slidesToShow = 1; 2791 } 2792 } 2793 2794 slider.slick({ 2795 cssEase: 'ease-out', 2796 dots: true, 2797 infinite: true, 2798 touchThreshold: 10, 2799 speed: 300, 2800 2801 prevArrow: '<a class="button the-icon slider_prev" href="#"><span class="button_icon"><i class="icon-left-open-big"></i></span></a>', 2802 nextArrow: '<a class="button the-icon slider_next" href="#"><span class="button_icon"><i class="icon-right-open-big"></i></span></a>', 2803 appendArrows: slider.siblings('.blog_slider_header').children('.slider_navigation'), 2804 2805 appendDots: slider.siblings('.slider_pager'), 2806 customPaging: pager, 2807 2808 rtl: rtl ? true : false, 2809 autoplay: mfn.slider.shop ? true : false, 2810 autoplaySpeed: mfn.slider.shop ? mfn.slider.shop : 5000, 2811 2812 slidesToShow: slickAutoResponsive(slider, slidesToShow), 2813 slidesToScroll: slickAutoResponsive(slider, slidesToShow) 2814 }); 2815 2816 // ON | debouncedresize 2817 2818 $(window).on('debouncedresize', function() { 2819 slider.slick('slickSetOption', 'slidesToShow', slickAutoResponsive(slider, slidesToShow), false); 2820 slider.slick('slickSetOption', 'slidesToScroll', slickAutoResponsive(slider, slidesToShow), true); 2821 }); 2822 2823 }); 2824 } 2825 2826 // Slider | Blog 2827 2828 function mfnSliderBlog() { 2829 2830 var pager = function(el, i) { 2831 return '<a>' + i + '</a>'; 2832 }; 2833 2834 $('.blog_slider_ul').each(function() { 2835 2836 var slider = $(this); 2837 var slidesToShow = 4; 2838 2839 var count = slider.closest('.blog_slider').data('count'); 2840 if (slidesToShow > count) { 2841 slidesToShow = count; 2842 if (slidesToShow < 1) { 2843 slidesToShow = 1; 2844 } 2845 } 2846 2847 slider.slick({ 2848 cssEase: 'ease-out', 2849 dots: true, 2850 infinite: true, 2851 touchThreshold: 10, 2852 speed: 300, 2853 2854 prevArrow: '<a class="button the-icon slider_prev" href="#"><span class="button_icon"><i class="icon-left-open-big"></i></span></a>', 2855 nextArrow: '<a class="button the-icon slider_next" href="#"><span class="button_icon"><i class="icon-right-open-big"></i></span></a>', 2856 appendArrows: slider.siblings('.blog_slider_header').children('.slider_navigation'), 2857 2858 appendDots: slider.siblings('.slider_pager'), 2859 customPaging: pager, 2860 2861 rtl: rtl ? true : false, 2862 autoplay: mfn.slider.blog ? true : false, 2863 autoplaySpeed: mfn.slider.blog ? mfn.slider.blog : 5000, 2864 2865 slidesToShow: slickAutoResponsive(slider, slidesToShow), 2866 slidesToScroll: slickAutoResponsive(slider, slidesToShow) 2867 }); 2868 2869 // On | debouncedresize 2870 2871 $(window).on('debouncedresize', function() { 2872 slider.slick('slickSetOption', 'slidesToShow', slickAutoResponsive(slider, slidesToShow), false); 2873 slider.slick('slickSetOption', 'slidesToScroll', slickAutoResponsive(slider, slidesToShow), true); 2874 }); 2875 2876 }); 2877 } 2878 2879 // Slider | Clients 2880 2881 function mfnSliderClients() { 2882 $('.clients_slider_ul').each(function() { 2883 2884 var slider = $(this); 2885 2886 slider.slick({ 2887 cssEase: 'ease-out', 2888 dots: false, 2889 infinite: true, 2890 touchThreshold: 10, 2891 speed: 300, 2892 2893 prevArrow: '<a class="button the-icon slider_prev" href="#"><span class="button_icon"><i class="icon-left-open-big"></i></span></a>', 2894 nextArrow: '<a class="button the-icon slider_next" href="#"><span class="button_icon"><i class="icon-right-open-big"></i></span></a>', 2895 appendArrows: slider.siblings('.blog_slider_header').children('.slider_navigation'), 2896 2897 rtl: rtl ? true : false, 2898 autoplay: mfn.slider.clients ? true : false, 2899 autoplaySpeed: mfn.slider.clients ? mfn.slider.clients : 5000, 2900 2901 slidesToShow: slickAutoResponsive(slider, 4), 2902 slidesToScroll: slickAutoResponsive(slider, 4) 2903 }); 2904 2905 // ON | debouncedresize 2906 2907 $(window).on('debouncedresize', function() { 2908 slider.slick('slickSetOption', 'slidesToShow', slickAutoResponsive(slider, 4), false); 2909 slider.slick('slickSetOption', 'slidesToScroll', slickAutoResponsive(slider, 4), true); 2910 }); 2911 2912 }); 2913 } 2914 2915 // Slider | Portfolio 2916 2917 function sliderPortfolio() { 2918 2919 $('.portfolio_slider_ul').each(function() { 2920 2921 var slider = $(this); 2922 var size = 380; 2923 var scroll = 5; 2924 2925 if (slider.closest('.portfolio_slider').data('size')) { 2926 size = slider.closest('.portfolio_slider').data('size'); 2927 } 2928 2929 if (slider.closest('.portfolio_slider').data('size')) { 2930 scroll = slider.closest('.portfolio_slider').data('scroll'); 2931 } 2932 2933 slider.slick({ 2934 cssEase: 'ease-out', 2935 dots: false, 2936 infinite: true, 2937 touchThreshold: 10, 2938 speed: 300, 2939 2940 prevArrow: '<a class="slider_nav slider_prev themebg" href="#"><i class="icon-left-open-big"></i></a>', 2941 nextArrow: '<a class="slider_nav slider_next themebg" href="#"><i class="icon-right-open-big"></i></a>', 2942 2943 rtl: rtl ? true : false, 2944 autoplay: mfn.slider.portfolio ? true : false, 2945 autoplaySpeed: mfn.slider.portfolio ? mfn.slider.portfolio : 5000, 2946 2947 slidesToShow: slickAutoResponsive(slider, 5, size), 2948 slidesToScroll: slickAutoResponsive(slider, scroll, size) 2949 }); 2950 2951 // ON | debouncedresize 2952 $(window).on('debouncedresize', function() { 2953 slider.slick('slickSetOption', 'slidesToShow', slickAutoResponsive(slider, 5, size), false); 2954 slider.slick('slickSetOption', 'slidesToScroll', slickAutoResponsive(slider, scroll, size), true); 2955 }); 2956 2957 }); 2958 } 2959 2960 // Slider | Slider 2961 2962 function sliderSlider() { 2963 2964 var pager = function(el, i) { 2965 return '<a>' + i + '</a>'; 2966 }; 2967 2968 $('.content_slider_ul').each(function() { 2969 2970 var slider = $(this); 2971 var count = 1; 2972 var centerMode = false;
2973 2974 if (slider.closest('.content_slider').hasClass('carousel')) { 2975 count = slickAutoResponsive(slider); 2976 2977 $(window).on('debouncedresize', function() { 2978 slider.slick('slickSetOption', 'slidesToShow', slickAutoResponsive(slider), false); 2979 slider.slick('slickSetOption', 'slidesToScroll', slickAutoResponsive(slider), true); 2980 }); 2981 } 2982 2983 if (slider.closest('.content_slider').hasClass('center')) { 2984 centerMode = true; 2985 } 2986 2987 slider.slick({ 2988 cssEase: 'cubic-bezier(.4,0,.2,1)', 2989 dots: true, 2990 infinite: true, 2991 touchThreshold: 10, 2992 speed: 300, 2993 2994 centerMode: centerMode, 2995 centerPadding: '20%', 2996 2997 prevArrow: '<a class="button the-icon slider_prev" href="#"><span class="button_icon"><i class="icon-left-open-big"></i></span></a>', 2998 nextArrow: '<a class="button the-icon slider_next" href="#"><span class="button_icon"><i class="icon-right-open-big"></i></span></a>', 2999 3000 adaptiveHeight: true, 3001 appendDots: slider.siblings('.slider_pager'), 3002 customPaging: pager, 3003 3004 rtl: rtl ? true : false, 3005 autoplay: mfn.slider.slider ? true : false, 3006 autoplaySpeed: mfn.slider.slider ? mfn.slider.slider : 5000, 3007 3008 slidesToShow: count, 3009 slidesToScroll: count 3010 }); 3011 3012 // Lightbox | disable on dragstart 3013 3014 var clickEvent = false; 3015 3016 slider.on('dragstart', '.slick-slide a[rel="lightbox"]', function(event) { 3017 if (lightboxAttr) { 3018 var events = $._data(this,'events'); 3019 if( events && Object.prototype.hasOwnProperty.call(events, 'click') ){ 3020 clickEvent = events.click[0]; 3021 $(this).addClass('off-click').off('click'); 3022 } 3023 } 3024 }); 3025 3026 // Lightbox | enable after change 3027 3028 slider.on('afterChange', function(event, slick, currentSlide, nextSlide) { 3029 if (lightboxAttr) { 3030 $('a.off-click[rel="lightbox"]', slider).removeClass('off-click').on('click', clickEvent); 3031 } 3032 }); 3033 3034 }); 3035 } 3036 3037 // Slider | Testimonials 3038 3039 function sliderTestimonials() { 3040 3041 var pager = function(el, i) { 3042 var img = $(el.$slides[i]).find('.single-photo-img').html(); 3043 return '<a>' + img + '</a>'; 3044 }; 3045 3046 $('.testimonials_slider_ul').each(function() { 3047 3048 var slider = $(this); 3049 3050 slider.slick({ 3051 cssEase: 'ease-out', 3052 dots: true, 3053 infinite: true, 3054 touchThreshold: 10, 3055 speed: 300, 3056 3057 prevArrow: '<a class="button the-icon slider_prev" href="#"><span class="button_icon"><i class="icon-left-open-big"></i></span></a>', 3058 nextArrow: '<a class="button the-icon slider_next" href="#"><span class="button_icon"><i class="icon-right-open-big"></i></span></a>', 3059 3060 adaptiveHeight: true, 3061 appendDots: slider.siblings('.slider_pager'), 3062 customPaging: pager, 3063 3064 rtl: rtl ? true : false, 3065 autoplay: mfn.slider.testimonials ? true : false, 3066 autoplaySpeed: mfn.slider.testimonials ? mfn.slider.testimonials : 5000, 3067 3068 slidesToShow: 1, 3069 slidesToScroll: 1 3070 }); 3071 3072 }); 3073 } 3074 3075})(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.