1; 2(function ($, window, document, undefined) { 3 'use strict'; 4 var PRO = window.PRO || {}; 5 6 7 var $proSearch, $proFixedHeader, $proMainMenu, $proFooter, $proFixedMenu, $proIsDevice, $proUnderDesk, $webuild_masthead, $webuild_has_admin_bar, $proSlider; 8 9 10 PRO.vars = function () { 11 12 $proSearch = document.getElementById('sb-search'); 13 14 $proMainMenu = $('.main-navigation'); 15 16 $proFixedHeader = (webuild_ajax.sticky) ? true : false; 17 18 $proFooter = $('footer'); 19 20 $proSlider = $('.pro-slider'); 21 22 $proFixedMenu = $('#header-sticky'); 23 24 $webuild_masthead = $('#masthead'); 25 26 $proIsDevice = ( navigator.userAgent.match(/(Android|webOS|BlackBerry|iPod|iPhone|iPad|Opera Mini)/) ) ? true : false; 27 28 $webuild_has_admin_bar = ( $('body').hasClass('admin-bar') ) ? true : false; 29 30 }; 31 32 PRO.dynamicVars = function () { 33 34 $proUnderDesk = ($(window).width() < 1024) ? true : false; 35 36 } 37 38 PRO.loadScreen = function () { 39 40 //Hide Website PreLoader 41 42 $("#preloader").addClass('preloader_animation'); 43 44 //remove Preloader div 45 46 setTimeout(function () { 47 48 $('#preloader').remove(); 49 50 }, 2000); 51 52 } 53 54 PRO.menuSetup = function () { 55 56 // top moving bar 57 58 $proMainMenu.lavaLamp({ 59 60 easing: 'easeOutBack' 61 62 }); 63 64 65 $proMainMenu.superfish({ 66 67 delay: 0, 68 69 animation: {opacity: '1'}, 70 71 animationOut: {opacity: '0'}, 72 73 speed: 380, 74 75 speedOut: 200, 76
77 cssArrows: false, 78 79 }); 80 81 // accordian menu 82 83 var $mobileMenu = $('#mobile-menu'); 84 85 if ($proMainMenu.hasClass('accordion-menu') || $mobileMenu.length > 0) { 86 87 if (!$mobileMenu.hasClass('already-slidedown')) { 88 89 $('.accordion-menu ul').proAccordionFunc(); 90 91 } 92 ; 93 94 $(".menu-open").click(function () { 95 96 $(this).fadeOut(0); 97 98 $(".menu-close").fadeIn(100); 99 100 $(".accordion-menu").slideDown(300).animate({top: '77px'}, ("slow")); 101 102 }); 103 104 105 $(".menu-close").click(function () { 106 107 $(this).fadeOut(0); 108 109 $(".menu-open").fadeIn(100); 110 111 $(".accordion-menu").animate({top: '70px'}, ("slow")).slideUp(300); 112 113 }); 114 115 } 116 117 118 } 119 120 PRO.compactMenuSetup = function () { 121 122 $("#compact-menu-toggle-open").click(function () { 123 124 $(this).fadeOut(0); 125 126 $("#compact-menu-toggle-close").fadeIn(100); 127 128 $(".menu-compact #top-menu .header-top").animate({width: '100%'}, (500)); 129 130 $(".compact-fade").delay(500).fadeIn(500); 131 132 }); 133 134 $("#compact-menu-toggle-close").click(function () { 135 136 $(this).fadeOut(0); 137 138 $("#compact-menu-toggle-open").fadeIn(0); 139 140 $(".menu-compact #top-menu .header-top").delay(100).animate({width: '250px'}, (300)); 141 142 $(".compact-fade").delay(0).fadeOut(100); 143 144 }); 145 146 } 147 148 PRO.miscSetup = function () { 149 150 $proFooter.find('.arrow-to-top').click(function (e) { 151 152 $('html, body').animate({scrollTop: 0}, 800); 153 154 return false; 155 156 }); 157 158 } 159 160 PRO.proTestimonial = function () { 161 162 163 if ($.jqexists('royalSlider')) { 164 165 166 $('.testimonialSlider').royalSlider({ 167 168 autoHeight: true, 169 170 arrowsNav: false, 171 172 fadeinLoadedSlide: true, 173 174 controlNavigation: 'bullets', 175 176 imageScaleMode: 'none', 177 178 imageAlignCenter: false, 179 180 loop: true, 181 182 loopRewind: true, 183 184 usePreloader: false, 185 186 transitionSpeed: 500, 187 188 easeInOut: 'easeInOutExpo', 189 190 easeOut: 'easeInOutExpo', 191 192 autoPlay: { 193 194 enabled: true, 195 196 pauseOnHover: true, 197 198 delay: 5000, // 5sec 199 200 } 201 202 }); 203 204 205 } 206 207 208 }; 209 210 211 PRO.fixedHeader = function () { 212 213 if ($proFixedHeader && !$proIsDevice && !webuild_ajax.sideMenu && !$proUnderDesk) { 214 215 var headerHeight = $('header').outerHeight(); 216 217 var $fixedHeader = $('#header-sticky'); 218 219 //var $logo = $('#header-sticky .logo'); 220 221 //var $others = $('#header-sticky .cart-info, #header-sticky .search-container, #header-sticky .primary-menu .navbar-nav > li > a'); 222 223 //var fixedHeaderHeight = $fixedHeader.outerHeight(); 224 225 //var animateHeight = fixedHeaderHeight + 25; 226 227 //var animateLogo = fixedHeaderHeight - 22; 228 229 //var animateOthers = fixedHeaderHeight + 13; 230 231 if ($('#wpadminbar').length > 0) { 232 233 var adminbar = $('#wpadminbar').height(); 234 235 $fixedHeader.css('top', adminbar + 'px'); 236 237 //headerHeight = headerHeight + adminbar; 238 239 } 240 241 242 $(window).scroll(function () { 243 244 if ($(window).scrollTop() > headerHeight) { 245 246 if (!$fixedHeader.is(':visible')) { 247 248 //$logo.css('line-height',animateLogo+'px'); 249 250 //$others.css({'line-height':animateOthers+'px','height':animateOthers+'px'}); 251 252 //$fixedHeader.height(animateHeight).show(); 253 254 $fixedHeader.fadeIn('fast'); 255 256 /* 257 258 // transition in css 259 260 //$fixedHeader.height(fixedHeaderHeight) 261 262 //$logo.css('line-height',fixedHeaderHeight+'px'); 263 264 265 266 $fixedHeader.animate({ 267 268 height: fixedHeaderHeight+'px', // to be changed 269 270 }, 500, "linear" 271 272 ); 273 274 $logo.animate({ 275 276 'line-height' : fixedHeaderHeight+'px', // to be changed 277 278 }, 500, "linear" 279 280 ); 281 282 changed 283 284 */ 285 286 /*$others.animate({ 287 288 'line-height' : fixedHeaderHeight+'px', // to be changed 289 290 'height' : fixedHeaderHeight+'px' 291 292 }, 500, "linear" 293 294 );*/ 295 296 $fixedHeader.addClass('fixed'); 297 298 } 299 300 } else { 301 302 $fixedHeader.hide().removeClass('fixed'); 303 304 } 305 306 }) 307 308 } 309 310 } 311 312 // SHORTCODES 313 314 PRO.proTab = function () { 315 316 $(document).on('click.bs.tab.data-api', '.bs-tab-nav a', function (e) { 317 318 e.preventDefault(); 319 320 $(this).tab('show'); 321 322 }); 323 324 }; 325 326 PRO.proAccordion = function () { 327 328 329 $('.pro-accordions').each(function () { 330 331 332 var $this = $(this), 333 334 $wrap = $this.find('.pro-accordion'); 335 336 337 $wrap.each(function () { 338 339 340 var $accordion = $(this), 341 342 $content = $accordion.find('.pro-accordion-content'); 343 344 345 $accordion.on('click', '.pro-accordion-title:not(.selected)', function (e) { 346 347 e.preventDefault(); 348 349 350 $wrap.find('.pro-accordion-title').removeClass('selected'); 351 352 $(this).addClass('selected'); 353 354 355 $this.find('.pro-accordion-content:visible').slideUp(250, 'easeInOutExpo'); 356 357 $content.slideDown(250, 'easeInOutExpo'); 358 359 360 }); 361 362 363 }); 364 365 366 }); 367 368 369 }; 370 371 372 PRO.proToggle = function () { 373 374 375 $('.pro-toggle').each(function () { 376 377 378 var $this = $(this), 379 380 $content = $this.find('.pro-toggle-content'); 381 382 383 $this.on('click', '.pro-toggle-title', function (e) { 384 385 e.preventDefault(); 386 387 $content.slideToggle(250, 'easeInOutExpo'); 388 389 $(this).toggleClass('selected'); 390 391 }); 392 393 394 }); 395 396 397 }; 398 399 PRO.proAlert = function () { 400 401 402 $('.pro-alert-dismissable').each(function () { 403 404 var $this = $(this); 405 406 $this.on('click', '.pro-alert-close', function (e) { 407 408 e.preventDefault(); 409 410 $this.slideUp(250, 'easeInOutExpo'); 411 412 }); 413 414 }); 415 416 417 }; 418 419 PRO.proFaq = function () { 420 421 422 $(".pro-faq").each(function () { 423 424 425 var $faq = $(this), 426 427 $faq_filter = $faq.find('.pro-faq-filter a'), 428 429 $faq_iso = $faq.find('.pro-faq-isotope'); 430 431 432 $faq_iso.isotope({ 433 434 containerClass: '', 435 436 hiddenClass: 'pro-faq-hidden', 437 438 animationEngine: 'best-available', 439 440 itemClass: 'pro-faq-item', 441 442 transformsEnabled: false, 443 444 resizesContainer: false, 445 446 hiddenStyle: {}, 447 448 visibleStyle: {}, 449 450 containerStyle: {}, 451 452 }); 453 454 455 $faq_filter.click(function (e) { 456 457 458 e.preventDefault(); 459 460 461 var $filter = $(this); 462 463 464 $filter.addClass('active').siblings().removeClass('active'); 465 466 $faq_iso.isotope({filter: $filter.attr('data-filter')}); 467 468 469 }); 470 471 472 }); 473 474 475 }; 476 477 PRO.bsToolTip = function () { 478 479 480 $('[data-toggle=tooltip]').tooltip(); 481 482 483 $('.pro-tooltip-trigger').each(function () { 484 485 486 var $this = $(this); 487 488 489 $($this.data('selector')).tooltip({ 490 491 title: $this.html(), 492 493 placement: $this.data('placement'), 494 495 trigger: $this.data('trigger'), 496 497 html: true, 498 499 container: 'body', 500 501 }); 502 503 504 }); 505 506 507 }; 508 509 510 PRO.wordRotate = function () { 511 512 $('.pro-word-rotator').each(function (index, element) { 513 514 var $el = $(this) 515 516 517 var itemsWrapper = $el.find(".word-rotate-items"); 518 519 var items = itemsWrapper.find("> span"); 520 521 var firstItem = items.eq(0); 522 523 $el.width(firstItem.width()); 524 525 var firstItemClone = firstItem.clone().css({'display': 'block', 'margin-bottom': itemHeight + 'px'}); 526 527 var itemHeight = firstItem.height(); 528 529 var currentItem = 1; 530 531 var currentTop = 0; 532 533 var widths = []; 534 535 itemsWrapper.find("> span").each(function (index, element) { 536 537 widths[index] = $(this).width(); 538 539 $(this).css({'display': 'block', 'margin-bottom': itemHeight + 'px'}); 540 541 }); 542 543 itemsWrapper.append(firstItemClone); 544
545 var delay = $el.attr('data-delay'); 546 547 $el 548 549 .height(itemHeight) 550 551 .addClass("active"); 552 553 setInterval(function () { 554 555 currentTop = (currentItem * (itemHeight * 2)); 556 557 $el.width(widths[currentItem]) // as it is 0 based 558 559 itemsWrapper.animate({ 560 561 top: -(currentTop) + "px" 562 563 }, 300, "easeOutQuad", function () { 564 565 566 currentItem++; 567 568 569 if (currentItem > items.length) { 570 571 572 itemsWrapper.css("top", 0); 573 574 $el.width(widths[0]) 575 576 currentItem = 1; 577 578 579 } 580 581 582 }); 583 584 585 }, delay); 586 587 }); 588 589 }; 590 591 PRO.portfolioWidthHeightFix = function (container) { 592 593 $('.portfolio-item-info', container).each(function () { 594 595 var $this = $(this), 596 597 $elem = $this.find('.portfolio-item-hover'), 598 599 el_width = $this.outerWidth(true), 600 601 el_height = $this.outerHeight(true); 602 603 $elem.css({"height": el_height, "width": el_width}); 604 605 }); 606 607 608 }; 609 610 PRO.isotopeInitalize = function () { 611 612 613 $('.isotope-container').each(function () { 614 615 var $this = $(this), 616 617 $iso = $this.find('.isotope-loop'), 618 619 $iso_loader = $this.find('.isotope-loading'), 620 621 $iso_wrapper = $this.find('.isotope-wrapper'), 622 623 $iso_filter = $this.find('.isotope-filter a'), 624 625 $iso_item = $this.find('.isotope-item'); 626 627 628 $iso_loader.show(); 629 630 $iso.imagesLoaded(function () { 631 632 setTimeout(function () { 633 634 635 $iso_loader.hide(); 636 637 $iso_wrapper.addClass('isotope-loaded'); 638 639 $iso_item.waypoint(function () { 640 641 $(this).addClass('in'); 642 643 }, { 644 645 offset: "95%", 646 647 triggerOnce: false 648 649 }); 650 651 652 }, 300); 653 654 655 PRO.portfolioWidthHeightFix($iso_item); 656 657 658 $iso.isotope({ 659 660 animationEngine: 'best-available', 661 662 layoutMode: $iso.data('layout') || 'masonry', 663 664 }); 665 666 667 $(window).on('debouncedresize', function () { 668 setTimeout(function () { 669 PRO.portfolioWidthHeightFix($iso_item); 670 $iso.isotope('reLayout'); 671 $(window).resize(); 672 }, 300); 673 }); 674 }); 675 676 $iso_filter.click(function (e) { 677 e.preventDefault(); 678 $(this).addClass('active').siblings().removeClass('active'); 679 $iso_item.addClass('in'); 680 var selector = $(this).attr('data-filter'); 681 $iso.isotope({filter: selector}); 682 }); 683 684 $('blockquote.twitter-tweet', $iso).bind("proEventResize", function () { 685 $iso.isotope('reLayout'); 686 }); 687 }); 688 }; 689 690 PRO.ajaxPagination = function () { 691 $('.ajax-load-more').each(function () { 692 var $this = $(this), 693 $container = $this.parent().parent().find('.isotope-loop'), 694 token = $this.data('token'), 695 settings = window['webuild_load_more_' + token], 696 is_isotope = parseInt(settings.isotope), 697 paging = 1, 698 flood = false, 699 ajax_data; 700 $this.bind('click', function () { 701 if (flood === false) { 702 paging++; 703 flood = true; 704 // set ajax data 705 ajax_data = $.extend({}, {action: "ajax-pagination", paged: paging}, settings); 706 $.ajax({
707 dataType: "html", 708 type: "POST", 709 url: webuild_ajax.ajaxurl, 710 data: ajax_data, 711 beforeSend: function () { 712 $this.addClass('more-loading'); 713 }, 714 success: function (result) { 715 var content = $(result).css('opacity', 0); 716 if (is_isotope) { 717 $container.append(content); 718 } else { 719 $(content).insertBefore($this.parent()); 720 } 721 $container.imagesLoaded(function () { 722 if ($.jqexists('mediaelementplayer')) { 723 $('video, audio').mediaelementplayer(); 724 } 725 if (is_isotope) { 726 $container.isotope('appended', content); 727 $container.isotope('reLayout'); 728 $('blockquote.twitter-tweet').bind("proEventResize", function () { 729 $container.isotope('reLayout'); 730 }); 731 PRO.portfolioWidthHeightFix($container); 732 } else { 733 content.animate({'opacity': 1}, 250, 'easeInOutExpo'); 734 PRO.portfolioWidthHeightFix($container); 735 } 736 // load button affecting after images loaded 737 $this.removeClass('more-loading'); 738 if (parseInt(settings.max_pages) == paging) { 739 $this.hide(); 740 } 741 }); 742 flood = false; 743 } 744 }); 745 } 746 return false; 747 }); 748 }); 749 }; 750 751 752 PRO.ajaxPortfolio = function () { 753 $('.portfolio-model-ajax').each(function () { 754 var $this = $(this), 755 $loader = $this.find('.pro-loader'), 756 $container = $this.find('.ajax-portfolio-container'), 757 $content = $this.find('.ajax-content'), 758 _current = 0; 759 $this.on('click', '.item-ajax-load', function (e) { 760 e.preventDefault(); 761 var $project = $(this), 762 _project_id = $project.data('post-id'), 763 _scrollTop = parseInt($this.offset().top) - 130; 764 // protected for same project load 765 766 if (_current == _project_id) { 767 return; 768 } 769 770 771 // check if project-opened 772 773 if ($container.hasClass('project-opened')) { 774 775 $container.removeClass('project-opened'); 776 777 } 778 779 780 $.ajax({
781 782 type: "POST", 783 784 url: webuild_ajax.ajaxurl, 785 786 data: { 787 788 action: 'ajax-portfolio', 789 790 id: _project_id 791 792 }, 793 794 dataType: "html", 795 796 beforeSend: function () { 797 798 $loader.fadeIn(); 799 800 $('body,html').animate({scrollTop: _scrollTop}, 500, 'easeInOutExpo'); 801 802 }, 803 804 success: function (html) { 805 806 807 var _obj = $content.html(html); 808 809 _obj.imagesLoaded(function () { 810 811 $container.addClass('project-opened'); 812 813 _current = _project_id; 814 815 }); 816 817 818 if ($.jqexists('mediaelementplayer')) { 819 820 $('video, audio').mediaelementplayer(); 821 822 } 823 824 825 }, 826 827 complete: function () { 828 829 $loader.hide(); 830 831 } 832 833 }); 834 835 836 }); 837 838 839 $this.on('click', '.ajax-close', function (e) { 840 841 e.preventDefault(); 842 843 $container.removeAttr('data-post-id').removeClass('project-opened'); 844 845 _current = 0; 846 847 }); 848 849 850 }); 851 852 853 }; 854 855 PRO.onePage = function () { 856 857 var _offset = 72; 858 859 if ($webuild_has_admin_bar) { 860 861 _offset = _offset + 32; 862 863 } 864 865 866 $('.pro-scrollto').each(function () { 867 868 $(this).on('click', function (e) { 869 870 e.preventDefault(); 871 872 $.scrollTo($(this).attr('href'), 1000, {offset: -_offset, easing: 'easeInOutExpo'}); 873 874 }); 875 876 }); 877 878 879 if ($('body').hasClass('page-template-page-templatespage-one-page-php')) { 880 881 882 var _header_height = parseInt($webuild_masthead.outerHeight(true) + $webuild_masthead.offset().top), 883 884 _adminbar_height = parseInt($('#wpadminbar').outerHeight(true)) || 0, 885 886 _sticky_height = $proFixedMenu.height(), 887 888 $navigation = $('.menu-class, #mobile-menu, #pro-fixed-nav'), 889 890 $fixed_nav = $('#pro-fixed-nav'), 891 892 _waypoint_offset = _header_height, 893 894 page_ids = $.makeArray(), 895 896 header_before = $.exists('#header-before'), 897 898 count = 0; 899 900 901 $fixed_nav.css('margin-top', -Math.floor($fixed_nav.outerHeight(true) / 2)); 902 903 904 $('.logo a').click(function (e) { 905 906 e.preventDefault(); 907 908 $.scrollTo(0, 1000, {easing: 'easeInOutExpo'}); 909 910 }); 911 912 $navigation.localScroll({ 913 914 target: 'body', 915 916 queue: true, 917 918 duration: 1000, 919 920 hash: true, 921 922 easing: 'easeInOutExpo', 923 924 onBefore: function (e, anchor, $target) { 925 926 927 if ($proUnderDesk) { 928 929 this.offset = 0; 930 931 } else if ($(anchor).offset().top > _header_height || header_before) { 932 933 this.offset = -( _sticky_height + _adminbar_height ); 934 935 } else { 936 937 this.offset = -_header_height; 938 939 } 940 941 942 _waypoint_offset = -this.offset; 943 944 945 }, 946 947 }); 948 949 } 950 951 }; 952 953 PRO.widgetTabs = function () { 954 955 $('.tabs-widget .tabset li a').click(function (e) { 956 957 e.preventDefault(); 958 959 }); 960 961 $('.tabs-widget').each(function () { 962 963 $(this).find('.tabset li:first').addClass('active').show(); //Activate first tab 964 965 $(this).find('.tab_content:first').show(); //Show first tab content 966 967 }); 968 969 $('.tabs-widget .tabset li').click(function (e) { 970 971 var tab_to_activate = $(this).find('a').attr('href'); 972 973 console.log(tab_to_activate); 974 975 $(this).parent().find(' > li').removeClass('active'); //Remove all 'active' classes 976 977 $(this).addClass('active'); // Add 'active' class to selected tab 978 979 980 $(this).parents('.tabs-widget').find('.tab_content').hide(); //Hide all tab content 981 982 $(this).parents('.tabs-widget').find(tab_to_activate).fadeIn(); //Fade in the new active tab content 983 984 }); 985 986 }; 987 988 PRO.openSearch = function () { 989 990 var $openSearch = $('.open-search'), 991 992 $searchCont = $('.search-box'), 993 994 $closeSearch = $('.close-box') 995 996 $openSearch.click(function () { 997 998 $searchCont.addClass('active-box'); 999 1000 //$('#search-field').focus(); 1001 1002 setTimeout(function () { 1003 1004 $('#search-field').focus(); 1005 1006 }, 300); 1007 1008 }) 1009 1010 $closeSearch.click(function () { 1011 1012 $searchCont.removeClass('active-box') 1013 1014 }) 1015 1016 } 1017 1018 PRO.footerEffect = function () { 1019 1020 if (!webuild_ajax.footerForm && !$proUnderDesk && webuild_ajax.showFooter && webuild_ajax.footerEffect) { 1021 1022 $('#content-wrapper, footer').addClass('fixed-footer'); 1023 1024 var marginTop = $('footer').outerHeight(); 1025 1026 $('#content-wrapper').css('margin-bottom', marginTop + 'px') 1027 1028 } 1029 1030 } 1031 1032 PRO.footerSelectMenu = function () { 1033 1034 // Create the dropdown base 12.02.14 1035 1036 $("<select />").prependTo(".mini-nav .menu-select"); 1037 1038 1039 // Create default option "Select" 1040 1041 $("<option />", { 1042 1043 "selected": "selected", 1044 1045 "value": "", 1046 1047 "text": "âââ" 1048 1049 }).appendTo(".mini-nav .menu-select select"); 1050 1051 1052 // Populate dropdown with menu items 1053 1054 $(".mini-nav").each(function () { 1055 1056 var elPar = $(this), 1057 1058 thisSelect = elPar.find("select"); 1059 1060 $("a", elPar).each(function () { 1061 1062 var el = $(this); 1063 1064 $("<option />", { 1065 1066 "value": el.attr("href"), 1067 1068 "text": el.text(), 1069 1070 "data-level": el.attr("data-level") 1071 1072 }).appendTo(thisSelect); 1073 1074 }); 1075 1076 }); 1077 1078 1079 $(".mini-nav select").change(function () { 1080 window.location = $(this).find("option:selected").val(); 1081 }); 1082 1083 $(".mini-nav select option").each(function () { 1084 1085 var $this = $(this), 1086 1087 winHref = window.location.href; 1088 1089 if ($this.attr('value') == winHref) { 1090 1091 $this.attr('selected', 'selected'); 1092 1093 } 1094 ; 1095 1096 }) 1097 1098 1099 /*!-Appearance for custom select*/ 1100 1101 $(' .mini-nav select').each(function () { 1102 1103 $(this).customSelect(); 1104 1105 }); 1106 1107 $(".menu-select select, .mini-nav .customSelect1").css("visibility", "visible"); 1108 1109 1110 } 1111 1112 PRO.shopTooltip = function () { 1113
1114 $('.yith-wcwl-add-to-wishlist a').each(function () { 1115 1116 roadtip(jQuery(this)); 1117 1118 }); 1119 1120 $('.compare-button a').each(function () { 1121 1122 roadtip(jQuery(this)); 1123 1124 }); 1125 1126 $('.add-to-cart a').each(function () { 1127 1128 roadtip(jQuery(this)); 1129 1130 }); 1131 1132 } 1133 1134 1135 PRO.fancybox = function () { 1136 1137 1138 $('.gallery-fancybox a, .fancybox-thumb').fancybox({ 1139 1140 beforeLoad: function () { 1141 1142 if (!this.title.length) { 1143 1144 this.title = this.element.find('img').attr('alt'); 1145 1146 } 1147 1148 }, 1149 1150 arrows: true, 1151 1152 padding: 7, 1153 1154 helpers: { 1155 1156 media: {}, 1157 1158 buttons: {}, 1159 1160 thumbs: { 1161 1162 width: 60, 1163 1164 height: 50, 1165 1166 source: function (item) { 1167 1168 1169 var href, thumb; 1170 1171 1172 thumb = $(item.element).data('thumbnail'); 1173 1174 1175 if (item.element) { 1176 1177 href = $(item.element).find('img').attr('src'); 1178 1179 } 1180 1181 1182 if (!href && item.type === 'image' && item.href) { 1183 1184 href = item.href; 1185 1186 } 1187 1188 1189 if (thumb) { 1190 1191 href = thumb; 1192 1193 } 1194 1195 1196 return href; 1197 1198 1199 } 1200 1201 } 1202 1203 } 1204 1205 }); 1206 1207 1208 $('.fancybox').fancybox({ 1209 1210 beforeLoad: function () { 1211 1212 if (!this.title.length) { 1213 1214 this.title = this.element.find('img').attr('alt'); 1215 1216 } 1217 1218 }, 1219 1220 padding: 7, 1221 1222 helpers: { 1223 1224 media: {} 1225 1226 } 1227 1228 }); 1229 1230 1231 }; 1232 1233 PRO.matchHeightVC = function () { 1234 $('.equal_height_column').matchHeight(); 1235 }; 1236 1237 PRO.shopCart = function () { 1238 1239 var $cartIcon = $('.shopping-cart'), 1240 1241 cont = $('.hover-helper'), 1242 1243 $cartItems = $('.cart-items-container'); 1244 1245 $(document).on('click', '.shopping-cart', function (e) { 1246 1247 e.preventDefault(); 1248 1249 $(this).parent('.hover-helper').toggleClass('active'); 1250 1251 }) 1252 1253 // hide on click anywhere outside 1254 1255 $(document).mouseup(function (e) { 1256 1257 var container = $(".hover-helper"); 1258 1259 if (!container.is(e.target) && container.has(e.target).length === 0) { 1260 1261 container.removeClass('active'); 1262 1263 } 1264 1265 }); 1266 1267 1268 // remove item from cart 1269 1270 $(document).on('click', '.ajax-remove-item', function (e) { 1271 1272 e.preventDefault(); 1273 1274 1275 var $thisbutton = $(this); 1276 1277 1278 var data = { 1279 1280 action: 'woocommerce_remove_from_cart', 1281 1282 remove_item: $thisbutton.attr('rel') 1283 1284 }; 1285 1286 1287 $.post(woocommerce_params.ajax_url, data, function (response) { 1288 1289 1290 var fragments = response.fragments, 1291 1292 cart_hash = response.cart_hash; 1293 1294 1295 if (fragments) { 1296 1297 $.each(fragments, function (key, value) { 1298 1299 console.log(key + '|' + value); 1300 1301 $(key).replaceWith(value); 1302 1303 }); 1304 1305 } 1306 1307 1308 }); 1309 1310 1311 }); 1312 1313 } 1314 1315 ////////////////////////////////////////////////////////////////////////////////////////////////////// 1316 // PARALLAX 1317 ////////////////////////////////////////////////////////////////////////////////////////////////////// 1318 var parallax = { 1319 1320 selector: 'div[data-stellar-ratio]', 1321 1322 init: function () { 1323 1324 if ($proIsDevice || !$(this.selector).length) { 1325 return; 1326 } 1327 1328 $(window).stellar({ 1329 horizontalScrolling: false, 1330 verticalOffset: 0, 1331 horizontalOffset: 0, 1332 responsive: true, 1333 scrollProperty: 'scroll', 1334 positionProperty: 'transform',
1335 parallaxBackgrounds: false, 1336 parallaxElements: true, 1337 hideDistantElements: false, 1338 }); 1339 parallax.settings(); 1340 $(window).resize(function () { 1341 parallax.settings(); 1342 }); 1343 }, 1344 settings: function () { 1345 1346 $(parallax.selector).each(function () { 1347 var $parallax = $(this), 1348 $container = $parallax.parent(), 1349 containerHeight = $container.outerHeight(), 1350 windowHeight = $(window).height(); 1351 1352 $parallax.css({ 1353 'height': containerHeight + windowHeight * 0.35, 1354 'top': 0 1355 }); 1356 }); 1357 } 1358 }; 1359 1360 1361 /* 1362 //////////////////////////////////////////////////////////////////////////////////////////////////// 1363 TITLE PARALLAX 1364 //////////////////////////////////////////////////////////////////////////////////////////////////// 1365 */ 1366 1367 var titleParallax = { 1368 1369 1370 selector: '.title-wrapper', 1371 1372 container: '.page-title-cont', 1373 1374 1375 init: function () { 1376 1377 if ($proIsDevice || $(this.container).data('effect') != 'parallax') { 1378 1379 return; 1380 1381 } 1382 1383 $(window).scroll(function () { 1384 1385 titleParallax.update(); 1386 1387 }); 1388 1389 }, 1390 1391 update: function () { 1392 1393 var offset = $webuild_masthead.outerHeight(true), 1394 1395 factor = 0; 1396 1397 if ($proSlider) { 1398 1399 offset = offset + $proSlider.outerHeight(true); 1400 1401 } 1402 1403 if ($(window).scrollTop() > offset) { 1404 1405 factor = $(window).scrollTop() - offset; 1406 1407 $(this.selector).transition({y: factor * .5}, 0) 1408 1409 .css('opacity', 1 - ( factor * .002 )); 1410 1411 } else { 1412 1413 $(this.selector).transition({y: 0}, 0) 1414 1415 .css('opacity', 1); 1416 1417 } 1418 1419 } 1420 1421 }; 1422 1423 1424 // helper functions 1425 1426 $.fn.proAccordionFunc = function () { 1427 1428 var $next, 1429 1430 parents = this.find('.menu-item-has-children.no-link a, .menu-item-has-children > i.drop'); 1431 1432 1433 parents.on("click", function (e) { 1434 1435 if (e.target.nodeName == "I") { 1436 1437 $next = $(this).next(); 1438 1439 } else { 1440 1441 e.preventDefault(); 1442 1443 $next = $(this).siblings('ul.sub-menu'); 1444 1445 } 1446 1447 1448 $next.slideToggle(); 1449 1450 $(this).parent().toggleClass('open'); 1451 1452 }); 1453 1454 }; 1455 1456 function roadtip(element) { 1457 1458 var tipText = element.html(); 1459 1460 element.bind('mouseover', function () { 1461 1462 if (jQuery('.roadtip').length == 0) { 1463 1464 element.before('<span class="roadtip">' + tipText + '</span>'); 1465 1466 1467 var tipWidth = jQuery('.roadtip').outerWidth(); 1468 1469 var tipPush = -(tipWidth / 2 - element.outerWidth() / 2); 1470 1471 jQuery('.roadtip').css('margin-left', tipPush); 1472 1473 } 1474 1475 }); 1476 1477 element.bind('mouseleave', function () { 1478 1479 jQuery('.roadtip').remove(); 1480 1481 }); 1482 1483 } 1484 1485 1486 $(document).ready(function () { 1487 PRO.vars(); 1488 1489 PRO.dynamicVars(); 1490 1491 PRO.menuSetup(); 1492 1493 if (webuild_ajax.compactMenu) { 1494 1495 PRO.compactMenuSetup(); 1496 1497 } 1498 1499 PRO.miscSetup(); 1500 1501 PRO.fixedHeader(); 1502 1503 PRO.proTab(); 1504 1505 PRO.proAccordion(); 1506 1507 PRO.proToggle(); 1508 1509 PRO.proAlert(); 1510 1511 PRO.proFaq(); 1512 1513 PRO.bsToolTip(); 1514 1515 PRO.wordRotate(); 1516 1517 PRO.widgetTabs(); 1518 1519 PRO.isotopeInitalize(); 1520 1521 PRO.ajaxPagination(); 1522 1523 PRO.ajaxPortfolio(); 1524 1525 PRO.fancybox(); 1526 1527 PRO.onePage(); 1528 1529 PRO.openSearch(); 1530 1531 PRO.footerEffect(); 1532 1533 PRO.proTestimonial(); 1534 1535 PRO.shopTooltip(); 1536 1537 PRO.shopCart(); 1538 1539 PRO.footerSelectMenu(); 1540 PRO.matchHeightVC(); 1541 1542 titleParallax.init(); 1543 parallax.init(); 1544 });
1545 1546 $(window).scroll(function () { 1547 1548 }); 1549 1550 $(window).load(function () { 1551 1552 PRO.loadScreen(); 1553 1554 }) 1555 1556 $(window).resize(function () { 1557 1558 PRO.dynamicVars(); 1559 1560 PRO.footerEffect(); 1561 1562 }); 1563 1564})(jQuery, window, document);
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.