1"use strict"; 2// Accordion 3 4function irecco_accordion_init() { 5 var item = jQuery('.wgl-accordion'); 6 7 item.each( function() { 8 var header = jQuery(this).find('.wgl-accordion_header'); 9 var content = jQuery(this).find('.wgl-accordion_content'); 10 var acc_type = jQuery(this).data('type'); 11 var speed = 400; 12 header.off("click"); 13 14 header.each( function() { 15 if (jQuery(this).data('default') == 'yes') { 16 jQuery(this).addClass('active'); 17 jQuery(this).next().slideDown(speed); 18 } 19 }) 20 21 header.on('click', function(e) { 22 e.preventDefault(); 23 var $this = jQuery(this); 24 25 if ( acc_type == 'accordion' ) { 26 $this.toggleClass('active'); 27 $this.next().slideToggle(speed); 28 } else if ( acc_type == 'toggle' ) { 29 $this.toggleClass('active'); 30 $this.next().slideToggle(speed); 31 content.not($this.next()).slideUp(speed); 32 header.not($this).removeClass('active'); 33 } 34 }) 35 }) 36} 37 38// Services Accordion 39function irecco_services_accordion_init() { 40 var item_module = jQuery('.wgl-accordion-services'); 41 42 item_module.each( function() { 43 var item = jQuery(this).find('.wgl-services_item'); 44 jQuery(this).find('.wgl-services_item:first-child').addClass('active'); 45 46 item.on('mouseover', function(e) { 47 jQuery(this).addClass('active').siblings().removeClass('active'); 48 }) 49 }) 50} 51(function($) { 52 jQuery(document).ready(function() { 53 irecco_ajax_load(); 54 }); 55 56 function irecco_ajax_load() { 57 var i, section; 58 var sections = document.getElementsByClassName('wgl_cpt_section'); 59 for (i = 0; i < sections.length; i++) { 60 section = sections[i]; 61 irecco_ajax_init(section); 62 } 63 } 64 65 var wait_load = false; 66 var offset_items = 0; 67 var infinity_item; 68 var js_offset; 69 70 function irecco_ajax_query(grid, section, request_data) { 71 if (wait_load) return; 72 wait_load = true; 73 request_data['offset_items'] = request_data.js_offset 74 ? request_data.js_offset 75 : offset_items; 76 request_data['items_load'] = request_data.items_load; 77 request_data['js_offset'] = request_data.js_offset 78 ? request_data.js_offset 79 : offset_items; 80 81 $.post( 82 wgl_core.ajaxurl, 83 { 84 action: 'wgl_ajax', 85 data: request_data 86 }, 87 function(response, status) { 88 var resp, new_items, load_more_hidden, count_products; 89 resp = document.createElement('div'); 90 resp.innerHTML = response; 91 new_items = $('.item', resp); 92 count_products = $('.woocommerce-result-count', resp); 93 94 load_more_hidden = $('.hidden_load_more', resp); 95 96 if (load_more_hidden.length) { 97 jQuery(section) 98 .find('.load_more_wrapper') 99 .fadeOut(300, function() { 100 $(this).remove(); 101 }); 102 } else { 103 jQuery(section) 104 .find('.load_more_wrapper .load_more_item') 105 .removeClass('loading'); 106 } 107 108 jQuery(section) 109 .find('.woocommerce-result-count') 110 .html(jQuery(count_products).html()); 111 112 if ($(grid).hasClass('carousel')) { 113 $(grid) 114 .find('.slick-track') 115 .append(new_items); 116 $(grid) 117 .find('.slick-dots') 118 .remove(); 119 $(grid) 120 .find('.wgl-carousel_slick') 121 .slick('reinit'); 122 } else if ($(grid).hasClass('grid')) { 123 new_items = new_items.hide(); 124 $(grid).append(new_items); 125 new_items.fadeIn('slow'); 126 } else { 127 var items = jQuery(new_items); 128 jQuery(grid) 129 .imagesLoaded() 130 .always(function() { 131 jQuery(grid) 132 .append(items) 133 .isotope('appended', items) 134 .isotope('reloadItems'); 135 136 setTimeout(function() { 137 jQuery(grid).isotope('layout'); 138 irecco_scroll_animation(); 139 updateFilter(); 140 }, 500); 141 }); 142 } 143 144 // Call vc waypoint settings 145 if (typeof jQuery.fn.waypoint === 'function') { 146 jQuery(grid) 147 .find( 148 '.wpb_animate_when_almost_visible:not(.wpb_start_animation)' 149 ) 150 .waypoint( 151 function() { 152 jQuery(this).addClass('wpb_start_animation animated'); 153 }, 154 { offset: '100%' } 155 ); 156 } 157 158 //Call video background settings 159 if (typeof jarallax === 'function') { 160 irecco_parallax_video(); 161 } else { 162 jQuery.getScript(wgl_core.JarallaxPluginVideo, function() { 163 jQuery 164 .getScript(wgl_core.JarallaxPlugin, function() {}) 165 .always(function(s, Status) { 166 jQuery(grid) 167 .find('.parallax-video') 168 .each(function() { 169 jQuery(this).jarallax({ 170 loop: true, 171 speed: 1, 172 videoSrc: jQuery(this).data('video'), 173 videoStartTime: jQuery(this).data('start'), 174 videoEndTime: jQuery(this).data('end') 175 }); 176 }); 177 }); 178 }); 179 } 180 181 //Call slick settings 182 if ( 183 jQuery(grid) 184 .find('.wgl-carousel_slick') 185 .size() > 0 186 ) { 187 jQuery.getScript(wgl_core.slickSlider).always(function(s, Status) { 188 jQuery(grid) 189 .find('.wgl-carousel_slick') 190 .each(function() { 191 destroyCarousel(jQuery(this)); 192 slickCarousel(jQuery(this)); 193 if (jQuery(grid).hasClass('blog_masonry')) { 194 jQuery(grid).isotope('layout'); 195 } 196 }); 197 }); 198 } 199 200 irecco_scroll_animation(); 201 //Update Items 202 203 var offset_data = $('.js_offset_items', resp); 204 request_data.js_offset = parseInt(offset_data.data('offset')); 205 206 wait_load = false;
207 } 208 ); 209 } 210 211 function irecco_ajax_init(section) { 212 offset_items = 0; 213 var grid, form, data_field, data, request_data, load_more; 214 215 //if Section CPT return 216 if (section == undefined) return; 217 218 //Get grid CPT 219 grid = section.getElementsByClassName('container-grid'); 220 if (!grid.length) return; 221 grid = grid[0]; 222 223 //Get form CPT 224 form = section.getElementsByClassName('posts_grid_ajax'); 225 if (!form.length) return; 226 form = form[0]; 227 228 //Get field form ajax 229 data_field = form.getElementsByClassName('ajax_data'); 230 if (!data_field.length) return; 231 data_field = data_field[0]; 232 233 data = data_field.value; 234 data = JSON.parse(data); 235 request_data = data; 236 237 //Add pagination 238 offset_items += request_data.post_count; 239 240 infinity_item = section.getElementsByClassName('infinity_item'); 241 242 if (infinity_item.length) { 243 infinity_item = infinity_item[0]; 244 if (jQuery(infinity_item).is_visible()) { 245 irecco_ajax_query(grid, section, request_data); 246 } 247 var lastScrollTop = 0; 248 249 jQuery(window).on('resize scroll', function() { 250 if (jQuery(infinity_item).is_visible()) { 251 var st = jQuery(this).scrollTop(); 252 if (st > lastScrollTop) { 253 irecco_ajax_query(grid, section, request_data); 254 } 255 lastScrollTop = st; 256 } 257 }); 258 } 259 260 load_more = section.getElementsByClassName('load_more_item'); 261 if (load_more.length) { 262 load_more = load_more[0]; 263 load_more.addEventListener( 264 'click', 265 function(e) { 266 e.preventDefault(); 267 jQuery(this).addClass('loading'); 268 irecco_ajax_query(grid, section, request_data); 269 }, 270 false 271 ); 272 } 273 } 274 275 function slickCarousel(grid) { 276 jQuery(grid).slick({ 277 draggable: true, 278 fade: true, 279 speed: 900, 280 cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)', 281 touchThreshold: 100 282 }); 283 } 284 function destroyCarousel(grid) { 285 if (jQuery(grid).hasClass('slick-initialized')) { 286 jQuery(grid).slick('destroy'); 287 } 288 } 289 290 function updateFilter() { 291 jQuery('.isotope-filter a').each(function() { 292 var data_filter = this.getAttribute('data-filter'); 293 var num = jQuery(this) 294 .closest('.wgl-portfolio') 295 .find('.wgl-portfolio-list_item') 296 .filter(data_filter).length; 297 jQuery(this) 298 .find('.number_filter') 299 .text(num); 300 if ( num != 0 && jQuery(this).hasClass('empty') ) { 301 jQuery(this).removeClass('empty'); 302 } 303 }); 304 } 305})(jQuery); 306 307function irecco_scroll_animation(){ 308 var portfolio = jQuery('.wgl-portfolio_container'); 309 var shop = jQuery('.wgl-products.appear-animation'); 310 311 //Scroll Animation 312 (function($) { 313 314 var docElem = window.document.documentElement; 315 316 function getViewportH() { 317 var client = docElem['clientHeight'], 318 inner = window['innerHeight']; 319 320 if( client < inner ) 321 return inner; 322 else 323 return client; 324 } 325 326 function scrollY() { 327 return window.pageYOffset || docElem.scrollTop; 328 } 329 330 // http://stackoverflow.com/a/5598797/989439 331 function getOffset( el ) { 332 var offsetTop = 0, offsetLeft = 0; 333 do { 334 if ( !isNaN( el.offsetTop ) ) { 335 offsetTop += el.offsetTop; 336 } 337 if ( !isNaN( el.offsetLeft ) ) { 338 offsetLeft += el.offsetLeft; 339 } 340 } while( el = el.offsetParent ) 341 342 return { 343 top : offsetTop, 344 left : offsetLeft 345 } 346 } 347 348 function inViewport( el, h ) {
349 var elH = el.offsetHeight, 350 scrolled = scrollY(), 351 viewed = scrolled + getViewportH(), 352 elTop = getOffset(el).top, 353 elBottom = elTop + elH, 354 h = h || 0; 355 356 return (elTop + elH * h) <= viewed && (elBottom - elH * h) >= scrolled; 357 } 358 359 function extend( a, b ) { 360 for( var key in b ) { 361 if( b.hasOwnProperty( key ) ) { 362 a[key] = b[key]; 363 } 364 } 365 return a; 366 } 367 368 function AnimOnScroll( el, options ) { 369 this.el = el; 370 this.options = extend( this.defaults, options ); 371 if(this.el.length){ 372 this._init(); 373 } 374 } 375 376 AnimOnScroll.prototype = { 377 defaults : { 378 viewportFactor : 0 379 }, 380 _init : function() { 381 this.items = Array.prototype.slice.call( jQuery(this.el ).children() ); 382 this.itemsCount = this.items.length; 383 this.itemsRenderedCount = 0; 384 this.didScroll = false; 385 this.delay = 100; 386 387 388 var self = this; 389 390 if(typeof imagesLoaded === 'function'){ 391 imagesLoaded( this.el, this._imgLoaded(self)); 392 }else{ 393 this._imgLoaded(self); 394 } 395 396 }, 397 _imgLoaded : function(self) { 398 399 var interval; 400 401 // the items already shown... 402 self.items.forEach( function( el, i ) { 403 if( inViewport( el ) ) { 404 405 self._checkTotalRendered(); 406 if(!jQuery(el).hasClass('show') && !jQuery(el).hasClass('animate') && inViewport( el, self.options.viewportFactor )){ 407 self._item_class(jQuery(el), self.delay, interval ); 408 self.delay += 200; 409 setTimeout( function() { 410 self.delay = 100; 411 }, 200 ); 412 } 413 } 414 } ); 415 416 // animate on scroll the items inside the viewport 417 window.addEventListener( 'scroll', function() { 418 self._onScrollFn(); 419 }, false ); 420 window.addEventListener( 'resize', function() { 421 self._resizeHandler(); 422 }, false ); 423 }, 424 425 _onScrollFn : function() { 426 var self = this; 427 if( !this.didScroll ) { 428 this.didScroll = true; 429 setTimeout( function() { self._scrollPage(); }, 60 ); 430 } 431 }, 432 _item_class : function(item_array, delay, interval) { 433 434 interval = setTimeout(function(){ 435 if ( item_array.length) { 436 jQuery(item_array).addClass( 'animate' ); 437 } else { 438 clearTimeout( interval ); 439 } 440 }, delay); 441 442 }, 443 444 _scrollPage : function() { 445 var self = this; 446 var interval; 447 448 this.items.forEach( function( el, i ) { 449 if( !jQuery(el).hasClass('show') && !jQuery(el).hasClass('animate') && inViewport( el, self.options.viewportFactor ) ) { 450 setTimeout( function() { 451 var perspY = scrollY() + getViewportH() / 2; 452 453 self._checkTotalRendered(); 454 self._item_class(jQuery(el), self.delay, interval); 455 self.delay += 200; 456 setTimeout( function() { 457 self.delay = 100; 458 }, 200 ); 459 460 }, 25 ); 461 } 462 }); 463 this.didScroll = false; 464 }, 465 _resizeHandler : function() { 466 var self = this; 467 function delayed() { 468 self._scrollPage(); 469 self.resizeTimeout = null; 470 } 471 if ( this.resizeTimeout ) { 472 clearTimeout( this.resizeTimeout ); 473 } 474 this.resizeTimeout = setTimeout( delayed, 1000 ); 475 }, 476 _checkTotalRendered : function() { 477 ++this.itemsRenderedCount; 478 if( this.itemsRenderedCount === this.itemsCount ) { 479 window.removeEventListener( 'scroll', this._onScrollFn ); 480 } 481 } 482 } 483 484 // add to global namespace 485 window.AnimOnScroll = AnimOnScroll; 486 487 })(jQuery); 488 489 new AnimOnScroll( portfolio, {} ); 490 new AnimOnScroll( shop, {} ); 491 492} 493// Scroll Up button 494function irecco_scroll_up() { 495 (function($) { 496 $.fn.goBack = function (options) { 497 var defaults = { 498 scrollTop: jQuery(window).height(), 499 scrollSpeed: 600,
500 fadeInSpeed: 1000, 501 fadeOutSpeed: 500 502 }; 503 var options = $.extend(defaults, options); 504 var $this = $(this); 505 $(window).on('scroll', function () { 506 if ($(window).scrollTop() > options.scrollTop) { 507 $this.addClass('active'); 508 } else { 509 $this.removeClass('active'); 510 } 511 }) 512 $this.on('click', function () { 513 $('html,body').animate({ 514 'scrollTop': 0 515 }, options.scrollSpeed) 516 }) 517 } 518 })(jQuery); 519 520 jQuery('#scroll_up').goBack(); 521}; 522function irecco_blog_masonry_init () { 523 if (jQuery(".blog_masonry").length) { 524 var blog_dom = jQuery(".blog_masonry").get(0); 525 var $grid = imagesLoaded( blog_dom, function() { 526 // initialize masonry 527 //* Wrapped in a short timeout function because $grid.imagesLoaded doesn't reliably lay out correctly 528 setTimeout(function(){ 529 jQuery(".blog_masonry").isotope({ 530 layoutMode: 'masonry', 531 masonry: { 532 columnWidth: '.item', 533 }, 534 itemSelector: '.item', 535 percentPosition: true 536 }); 537 jQuery(window).trigger('resize'); 538 }, 250); 539 }); 540 } 541} 542// wgl Carousel List 543function irecco_carousel_slick() { 544 var carousel = jQuery('.wgl-carousel_slick'); 545 546 if (carousel.length !== 0 ) { 547 carousel.each( function(item, value) { 548 if (jQuery(this).hasClass('slick-initialized')) { 549 jQuery(this).slick('destroy'); 550 } 551 552 if (jQuery(this).hasClass('fade_slick')) { 553 jQuery(this).slick({ 554 draggable: true, 555 fade: true, 556 speed: 900, 557 cssEase: 'cubic-bezier(0.7, 0, 0.3, 1)', 558 touchThreshold: 100 559 }); 560 } else { 561 jQuery(this).slick({}); 562 } 563 }); 564 } 565} 566 567function irecco_circuit_services() { 568 if (jQuery('.irecco_module_circuit_services').length) { 569 jQuery('.irecco_module_circuit_services').each(function(){ 570 var $circle = jQuery(this).find('.services_item-icon'); 571 572 var agle = 360 / $circle.length; 573 var agleCounter = -1; 574 575 $circle.each(function() { 576 var $this = jQuery(this); 577 578 jQuery(this).parents('.services_item-wrap:first-child').addClass('active'); 579 $this.on('mouseover', function(){ 580 jQuery(this).parents('.services_item-wrap').addClass('active').siblings().removeClass('active'); 581 }) 582 583 var percentWidth = (100 * parseFloat($this.css('width')) / parseFloat($this.parent().css('width'))); 584 var curAgle = agleCounter * agle; 585 var radAgle = curAgle * Math.PI / 180; 586 var x = (50 + ((50 - (percentWidth / 2)) * Math.cos(radAgle))) - (percentWidth / 2); 587 var y = (50 + ((50 - (percentWidth / 2)) * Math.sin(radAgle))) - (percentWidth / 2); 588 589 $this.css({ 590 left: x + '%', 591 top: y + '%' 592 }); 593 594 agleCounter++; 595 }); 596 597 }); 598 } 599} 600function irecco_circuit_services_resize (){ 601 if (jQuery('.irecco_module_circuit_services').length) { 602 setTimeout(function(){ 603 jQuery('.irecco_module_circuit_services').each(function(){ 604 var $this = jQuery(this); 605 var wwidth = $this.width(); 606 if (wwidth < 370){ 607 $this.removeClass('tablet_resp').addClass('mobile_resp'); 608 } else if (wwidth < 460) { 609 $this.removeClass('mobile_resp').addClass('tablet_resp'); 610 } else { 611 $this.removeClass('tablet_resp mobile_resp'); 612 } 613 }); 614 }, 1); 615 } 616} 617/*! 618 * JavaScript Cookie v2.2.0 619 * https://github.com/js-cookie/js-cookie 620 * 621 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack 622 * Released under the MIT license 623 */ 624;(function (factory) { 625 var registeredInModuleLoader; 626 if (typeof define === 'function' && define.amd) { 627 define(factory); 628 registeredInModuleLoader = true; 629 } 630 if (typeof exports === 'object') { 631 module.exports = factory(); 632 registeredInModuleLoader = true; 633 } 634 if (!registeredInModuleLoader) { 635 var OldCookies = window.Cookies; 636 var api = window.Cookies = factory(); 637 api.noConflict = function () { 638 window.Cookies = OldCookies; 639 return api; 640 }; 641 } 642}(function () { 643 function extend () { 644 var i = 0; 645 var result = {}; 646 for (; i < arguments.length; i++) { 647 var attributes = arguments[ i ]; 648 for (var key in attributes) { 649 result[key] = attributes[key]; 650 } 651 } 652 return result; 653 } 654 655 function decode (s) { 656 return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); 657 } 658 659 function init (converter) { 660 function api() {} 661
662 function set (key, value, attributes) { 663 if (typeof document === 'undefined') { 664 return; 665 } 666 667 attributes = extend({ 668 path: '/' 669 }, api.defaults, attributes); 670 671 if (typeof attributes.expires === 'number') { 672 attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); 673 } 674 675 // We're using "expires" because "max-age" is not supported by IE 676 attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; 677 678 try { 679 var result = JSON.stringify(value); 680 if (/^[\{\[]/.test(result)) { 681 value = result; 682 } 683 } catch (e) {} 684 685 value = converter.write ? 686 converter.write(value, key) : 687 encodeURIComponent(String(value)) 688 .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); 689 690 key = encodeURIComponent(String(key)) 691 .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent) 692 .replace(/[\(\)]/g, escape); 693 694 var stringifiedAttributes = ''; 695 for (var attributeName in attributes) { 696 if (!attributes[attributeName]) { 697 continue; 698 } 699 stringifiedAttributes += '; ' + attributeName; 700 if (attributes[attributeName] === true) { 701 continue; 702 } 703 704 // Considers RFC 6265 section 5.2: 705 // ... 706 // 3. If the remaining unparsed-attributes contains a %x3B (";") 707 // character: 708 // Consume the characters of the unparsed-attributes up to, 709 // not including, the first %x3B (";") character. 710 // ... 711 stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; 712 } 713 714 return (document.cookie = key + '=' + value + stringifiedAttributes); 715 } 716 717 function get (key, json) { 718 if (typeof document === 'undefined') { 719 return; 720 } 721 722 var jar = {}; 723 // To prevent the for loop in the first place assign an empty array 724 // in case there are no cookies at all. 725 var cookies = document.cookie ? document.cookie.split('; ') : []; 726 var i = 0; 727 728 for (; i < cookies.length; i++) { 729 var parts = cookies[i].split('='); 730 var cookie = parts.slice(1).join('='); 731 732 if (!json && cookie.charAt(0) === '"') { 733 cookie = cookie.slice(1, -1); 734 } 735 736 try { 737 var name = decode(parts[0]); 738 cookie = (converter.read || converter)(cookie, name) || 739 decode(cookie); 740 741 if (json) { 742 try { 743 cookie = JSON.parse(cookie); 744 } catch (e) {} 745 } 746 747 jar[name] = cookie; 748 749 if (key === name) { 750 break; 751 } 752 } catch (e) {} 753 } 754 755 return key ? jar[key] : jar; 756 } 757 758 api.set = set; 759 api.get = function (key) { 760 return get(key, false /* read as raw */); 761 }; 762 api.getJSON = function (key) { 763 return get(key, true /* read as json */); 764 }; 765 api.remove = function (key, attributes) { 766 set(key, '', extend(attributes, { 767 expires: -1 768 })); 769 }; 770 771 api.defaults = {}; 772 773 api.withConverter = init; 774 775 return api; 776 } 777 778 return init(function () {}); 779})); 780// wgl Countdown function init 781function irecco_countdown_init () { 782 var countdown = jQuery('.wgl-countdown'); 783 if (countdown.length !== 0 ) { 784 countdown.each(function () { 785 var data_atts = jQuery(this).data('atts'); 786 var time = new Date(+data_atts.year, +data_atts.month-1, +data_atts.day, +data_atts.hours, +data_atts.minutes); 787 jQuery(this).countdown({ 788 until: time, 789 padZeroes: true, 790 digits: [ 791 '<span>0</span>', 792 '<span>1</span>', 793 '<span>
7932</span>', 794 '<span>3</span>', 795 '<span>4</span>', 796 '<span>5</span>', 797 '<span>6</span>', 798 '<span>7</span>', 799 '<span>8</span>', 800 '<span>9</span>', 801 ], 802 format: data_atts.format ? data_atts.format : 'yowdHMS', 803 labels: [data_atts.labels[0],data_atts.labels[1],data_atts.labels[2],data_atts.labels[3],data_atts.labels[4],data_atts.labels[5], data_atts.labels[6], data_atts.labels[7]], 804 labels1: [data_atts.labels[0],data_atts.labels[1],data_atts.labels[2], data_atts.labels[3], data_atts.labels[4], data_atts.labels[5], data_atts.labels[6], data_atts.labels[7]] 805 }); 806 }); 807 } 808} 809// wgl Counter 810function irecco_counter_init() { 811 var counters = jQuery('.wgl-counter'); 812 813 if (counters.length) { 814 counters.each(function() { 815 var counter = jQuery(this).find( 816 '.wgl-counter_value-wrap .wgl-counter_value.value-placeholder' 817 ); 818 counter.appear(function() { 819 var max = jQuery(this).data('end-value'), 820 from = jQuery(this).data('start-value'), 821 speed = jQuery(this).data('speed'); 822 823 counter.countTo({ 824 from: from, 825 to: max, 826 speed: speed, 827 refreshInterval: 10 828 }); 829 }); 830 }); 831 } 832} 833 834 835function irecco_dynamic_styles(){ 836 var style = jQuery('#irecco-footer-inline-css'); 837 838 (function($) { 839 840 $.fn.wglAddDynamicStyles = function() { 841 842 if (this.length === 0) { return this; } 843 844 return this.each(function () { 845 var $style = '', 846 self = jQuery(this); 847 848 var init = function() { 849 $style += self.text(); 850 self.remove(); 851 appendStyle(); 852 }, 853 appendStyle = function(){ 854 jQuery('head').append('<style type="text/css">'+$style+'</style>'); 855 }; 856 857 /*Init*/ 858 init(); 859 }); 860 861 }; 862 })(jQuery); 863 864 style.wglAddDynamicStyles(); 865 866} 867//https://gist.github.com/chriswrightdesign/7955464 868function mobilecheck() { 869 var check = false; 870 (function(a){if(/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
870sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera); 871 return check; 872} 873 874//Add Click event for the mobile device 875var click = mobilecheck() ? ('ontouchstart' in document.documentElement ? 'touchstart' : 'click') : 'click'; 876 877function initClickEvent(){ 878 click = mobilecheck() ? ('ontouchstart' in document.documentElement ? 'touchstart' : 'click') : 'click'; 879} 880jQuery(window).on('resize', initClickEvent); 881 882/* 883 ** Plugin for counter shortcode 884 */ 885(function($) { 886 "use strict"; 887 888 $.fn.countTo = function(options) { 889 // merge the default plugin settings with the custom options 890 options = $.extend({}, $.fn.countTo.defaults, options || {}); 891 892 // how many times to update the value, and how much to increment the value on each update 893 var loops = Math.ceil(options.speed / options.refreshInterval), 894 increment = (options.to - options.from) / loops; 895 896 return $(this).each(function() { 897 var _this = this, 898 loopCount = 0, 899 value = options.from, 900 interval = setInterval(updateTimer, options.refreshInterval); 901 902 function updateTimer() { 903 value += increment; 904 loopCount++; 905 $(_this).html(value.toFixed(options.decimals)); 906 907 if (typeof(options.onUpdate) === 'function') { 908 options.onUpdate.call(_this, value); 909 } 910 911 if (loopCount >= loops) { 912 clearInterval(interval); 913 value = options.to; 914 915 if (typeof(options.onComplete) === 'function') { 916 options.onComplete.call(_this, value); 917 } 918 } 919 } 920 }); 921 }; 922 923 $.fn.countTo.defaults = { 924 from: 0, // the number the element should start at 925 to: 100, // the number the element should end at 926 speed: 1000, // how long it should take to count between the target numbers 927 refreshInterval: 100, // how often the element should be updated 928 decimals: 0, // the number of decimal places to show 929 onUpdate: null, // callback method for every time the element is updated, 930 onComplete: null // callback method for when the element finishes updating 931 }; 932})(jQuery); 933 934/* 935 ** Plugin for slick Slider 936 */ 937function irecco_slick_navigation_init (){ 938 jQuery.fn.irecco_slick_navigation = function (){ 939 jQuery(this).each( function (){ 940 var el = jQuery(this); 941 jQuery(this).find('span.left_slick_arrow').on("click", function() { 942 jQuery(this).closest('.wgl_cpt_section').find('.slick-prev').trigger('click'); 943 }); 944 jQuery(this).find('span.right_slick_arrow').on("click", function() { 945 jQuery(this).closest('.wgl_cpt_section').find('.slick-next').trigger('click'); 946 }); 947 }); 948 } 949} 950 951/* 952 ** Plugin IF visible element 953 */ 954function is_visible_init (){ 955 jQuery.fn.is_visible = function (){ 956 var elementTop = jQuery(this).offset().top; 957 var elementBottom = elementTop + jQuery(this).outerHeight(); 958 var viewportTop = jQuery(window).scrollTop(); 959 var viewportBottom = viewportTop + jQuery(window).height(); 960 return elementBottom > viewportTop && elementTop < viewportBottom; 961 } 962} 963 964/* 965 ** Preloader 966 */ 967jQuery(window).load(function(){ 968 jQuery('#preloader-wrapper').fadeOut(); 969}); 970// wgl image comparison 971function irecco_image_comparison () { 972 var item = jQuery('.wgl-image_comparison.cocoen'); 973 if (item.length !== 0 ) { 974 item.each(function(){ 975 jQuery(this).cocoen(); 976 }); 977 } 978} 979 980// wgl Image Layers 981function irecco_img_layers() { 982 jQuery('.wgl-image-layers').each(function() { 983 var container = jQuery(this); 984 var initImageLayers = function(){ 985 container.appear(function() { 986 container.addClass('img-layer_animate'); 987 },{done:true}) 988 } 989 initImageLayers(); 990 // jQuery(window).on('resize', initImageLayers); 991 // jQuery(window).on('load', initImageLayers); 992 }); 993} 994function irecco_isotope () { 995 if (jQuery(".isotope").length) { 996 997 var portfolio_dom = jQuery(".isotope").get(0); 998 999 var $grid = imagesLoaded( portfolio_dom, function() { 1000 // initialize masonry 1001 var mode = jQuery(".isotope").hasClass('fit_rows') ? 'fitRows' : 'masonry';
1002 //* Wrapped in a short timeout function because $grid.imagesLoaded doesn't reliably lay out correctly 1003 setTimeout(function(){ 1004 jQuery(".isotope").isotope({ 1005 layoutMode: mode, 1006 percentPosition: true, 1007 itemSelector: '.wgl-portfolio-list_item, .item', 1008 masonry: { 1009 columnWidth: '.wgl-portfolio-list_item-size, .wgl-portfolio-list_item, .item', 1010 } 1011 }).isotope( 'layout' ); 1012 1013 jQuery(window).trigger('resize'); 1014 }, 250); 1015 1016 }); 1017 1018 jQuery('.isotope-filter a').each(function() { 1019 var data_filter = this.getAttribute('data-filter'); 1020 var num = jQuery(this) 1021 .closest('.wgl-portfolio') 1022 .find('.wgl-portfolio-list_item') 1023 .filter(data_filter).length; 1024 jQuery(this) 1025 .find('.number_filter') 1026 .text(num); 1027 // fix empty categories 1028 if (num == 0) { 1029 jQuery(this).addClass('empty'); 1030 } 1031 }); 1032 1033 var $filter = jQuery('.isotope-filter a'); 1034 $filter.on('click', function(e) { 1035 e.preventDefault(); 1036 jQuery(this) 1037 .addClass('active') 1038 .siblings() 1039 .removeClass('active'); 1040 1041 var filterValue = jQuery(this).attr('data-filter'); 1042 1043 jQuery(this) 1044 .closest('.wgl_cpt_section') 1045 .find('.isotope') 1046 .isotope({ filter: filterValue }); 1047 }); 1048 } 1049} 1050 1051function irecco_menu_lavalamp(){ 1052 var lavalamp = jQuery('.menu_line_enable > ul'); 1053 if (lavalamp.length !== 0) { 1054 lavalamp.each(function(){ 1055 var $this = jQuery(this); 1056 $this.lavalamp({ 1057 easing: 'easeInOutCubic', 1058 duration: 600, 1059 }); 1060 }); 1061 } 1062} 1063 1064(function($, window) { 1065 var Lavalamp = function(element, options) { 1066 this.element = $(element).data('lavalamp', this); 1067 this.options = $.extend({}, this.options, options); 1068 1069 this.init(); 1070 }; 1071 1072 Lavalamp.prototype = { 1073 options: { 1074 current: '.current-menu-ancestor,.current-menu-item,.current-category-ancestor,.current-page-ancestor,.current_page_parent', 1075 items: 'li', 1076 bubble: '<div class="lavalamp-object"></div>', 1077 animation: false, 1078 blur: $.noop, 1079 focus: $.noop, 1080 duration: 600, 1081 }, 1082 easing: 'ease', // Easing transition 1083 duration: 700, // Duration of animation 1084 element: null, 1085 current: null, 1086 bubble: null, 1087 _focus: null, 1088 init: function() { 1089 var resizeTimer, 1090 self = this, 1091 child = self.element.children('li'); 1092 1093 this.onWindowResize = function() { 1094 if (resizeTimer) { 1095 clearTimeout(resizeTimer); 1096 } 1097 1098 resizeTimer = setTimeout(function() { 1099 self.reload(); 1100 }, 100); 1101 }; 1102 1103 $(window).bind('resize.lavalamp', this.onWindowResize); 1104 1105 $(child).addClass('lavalamp-item'); 1106 1107 this.element 1108 .on('mouseenter.lavalamp', '.lavalamp-item' , function() { 1109 self.current.each(function() { 1110 self.options.blur.call(this, self); 1111 }); 1112 1113 self._move($(this)); 1114 }) 1115 .on('mouseleave.lavalamp', function() { 1116 if (self.current.index(self._focus) < 0) { 1117 self._focus = null; 1118 1119 self.current.each(function() { 1120 self.options.focus.call(this, self); 1121 }); 1122 1123 self._move(self.current); 1124 } 1125 }); 1126 1127 this.bubble = $.isFunction(this.options.bubble) 1128 ? this.options.bubble.call(this, this.element) 1129 : $(this.options.bubble).prependTo(this.element); 1130 1131 self.element.addClass('lavalamp'); 1132 self.element.find('.lavalamp-object').addClass(self.options.easing); 1133 1134 this.reload(); 1135 1136 self.element.addClass("lavalamp_animate") 1137 }, 1138 reload: function() { 1139 this.current = this.element.children(this.options.current); 1140 1141 if (this.current.size() === 0) { 1142 this.current = this.element.children().not('.lavalamp-object').eq(0); 1143 } 1144 1145 this._move(this.current, false); 1146 }, 1147 destroy: function() { 1148 if (this.bubble) { 1149 this.bubble.remove(); 1150 } 1151 1152 this.element.unbind('.lavalamp'); 1153 $(window).unbind('resize.lavalamp', this.onWindowResize); 1154 }, 1155 _move: function(el, animate) { 1156 var pos = el.position(); 1157 pos.left = pos.left + parseInt(el.children('a').css('paddingLeft')) 1158 1159 var properties = { 1160 transform: 'translate('+pos.left+'px,'+pos.top+'px)', 1161 width: '25px', 1162 }; 1163 1164 this._focus = el; 1165 1166 // Check for CSS3 animations 1167 if(this.bubble.css('opacity') === "0"){ 1168 this.bubble.css({ 1169 WebkitTransitionProperty: "opacity", 1170 msTransitionProperty: "opacity", 1171 MozTransitionProperty: "opacity", 1172 OTransitionProperty: "opacity", 1173 transitionProperty: "opacity", 1174 WebkitTransitionDuration: '0s', 1175 msTransitionDuration: '0s', 1176 MozTransitionDuration: '0s', 1177 OTransitionDuration: '0s', 1178 transitionDuration: '0s', 1179 1180 }); 1181 }else{ 1182 this.bubble.css({ 1183 WebkitTransitionProperty: "all", 1184 msTransitionProperty: "all", 1185 MozTransitionProperty: "all", 1186 OTransitionProperty: "all", 1187 transitionProperty: "all", 1188 WebkitTransitionDuration: this.options.duration / 1000 + 's', 1189 msTransitionDuration: this.options.duration / 1000 + 's', 1190 MozTransitionDuration: this.options.duration / 1000 + 's', 1191 OTransitionDuration: this.options.duration / 1000 + 's', 1192 transitionDuration: this.options.duration / 1000 + 's', 1193 }) 1194 } 1195 1196 this.bubble.css(properties); 1197 } 1198 }; 1199 1200 $.fn.lavalamp = function(options) { 1201 if (typeof options === 'string') { 1202 var instance = $(this).data('lavalamp'); 1203 return instance[options].apply(instance, Array.prototype.slice.call(arguments, 1)); 1204 } else { 1205 return this.each(function() { 1206 var instance = $(this).data('lavalamp'); 1207 1208 if (instance) { 1209 $.extend(instance.options, options || {}); 1210 instance.reload(); 1211 } else { 1212 new Lavalamp(this, options); 1213 } 1214 }); 1215 } 1216 }; 1217})(jQuery, window); 1218 1219 1220(function( $ ) { 1221 1222 $(document).on('click', '.sl-button', function() { 1223 var button = $(this); 1224 var post_id = button.attr('data-post-id'); 1225 var security = button.attr('data-nonce'); 1226 var iscomment = button.attr('data-iscomment'); 1227 var allbuttons; 1228 if ( iscomment === '1' ) { /* Comments can have same id */ 1229 allbuttons = $('.sl-comment-button-'+post_id); 1230 } else { 1231 allbuttons = $('.sl-button-'+post_id); 1232 } 1233 var loader = allbuttons.next('#sl-loader'); 1234 if (post_id !== '') { 1235 $.ajax({ 1236 type: 'POST', 1237 url: wgl_core.ajaxurl, 1238 data : { 1239 action : 'irecco_like', 1240 post_id : post_id, 1241 nonce : security, 1242 is_comment : iscomment, 1243 }, 1244 beforeSend:function(){ 1245 loader.html(' <div class="loader">Loading...</div>'); 1246 }, 1247 success: function(response){ 1248 var icon = response.icon; 1249 var count = response.count; 1250 allbuttons.html(icon+count); 1251 if(response.status === 'unliked') { 1252 var like_text = wgl_core.like; 1253 allbuttons.prop('title', like_text); 1254 allbuttons.removeClass('liked'); 1255 } else { 1256 var unlike_text = wgl_core.unlike; 1257 allbuttons.prop('title', unlike_text); 1258 allbuttons.addClass('liked'); 1259 } 1260 loader.empty(); 1261 } 1262 }); 1263 1264 } 1265 return false;
1266 }); 1267 1268})( jQuery ); 1269function irecco_link_scroll () { 1270 jQuery('a.smooth-scroll, .smooth-scroll').on('click', function(event){ 1271 var href; 1272 if(this.tagName == 'A') { 1273 href = jQuery.attr(this, 'href'); 1274 } else { 1275 var that = jQuery(this).find('a'); 1276 href = jQuery(that).attr('href'); 1277 } 1278 jQuery('html, body').animate({ 1279 scrollTop: jQuery( href ).offset().top 1280 }, 500); 1281 event.preventDefault(); 1282 }); 1283} 1284//WGL MEGA MENUS GET AJAX POSTS 1285function irecco_ajax_mega_menu(){ 1286 var megaMenuAjax = false; 1287 var node_str = '<div class="mega_menu_wrapper_overlay">'; 1288 node_str += '<div class="preloader_type preloader_dot">'; 1289 node_str += '<div class="mega_menu_wrapper_preloader wgl_preloader dot">'; 1290 node_str += '<span></span>'; 1291 node_str += '<span></span>'; 1292 node_str += '<span></span>'; 1293 node_str += '</div>'; 1294 node_str += '</div>'; 1295 node_str += '</div>'; 1296 1297 ( function($){ 1298 irecco_ajax_mega_menu_init(); 1299 1300 function irecco_ajax_mega_menu_init() { 1301 1302 var grid, mega_menu_item, mega_menu_item_parent; 1303 1304 mega_menu_item = document.querySelectorAll('li.mega-menu ul.mega-menu.sub-menu.mega-cat-sub-categories li'); 1305 mega_menu_item_parent = document.querySelectorAll('li.mega-menu.mega-cat'); 1306 1307 if ( mega_menu_item.length ){ 1308 1309 for (var i = 0; i < mega_menu_item.length; i++) { 1310 1311 // Define an anonymous function here, to make it possible to use the i variable. 1312 (function (i) { 1313 var grid = mega_menu_item[i].closest('.mega-menu-container').getElementsByClassName( 'mega-ajax-content' ); 1314 irecco_ajax_mega_menu_event(mega_menu_item[i], grid); 1315 }(i)); 1316 } 1317 } 1318 1319 if ( mega_menu_item_parent.length ){ 1320 1321 for (var i = 0; i < mega_menu_item_parent.length; i++) { 1322 1323 // Define an anonymous function here, to make it possible to use the i variable. 1324 (function (i) { 1325 var grid = mega_menu_item_parent[i].getElementsByClassName( 'mega-ajax-content' ); 1326 irecco_ajax_mega_menu_event(mega_menu_item_parent[i], grid); 1327 }(i)); 1328 } 1329 } 1330 } 1331 1332 function irecco_ajax_mega_menu_event(item, grid) { 1333 var request_data = {}; 1334 1335 1336 item.addEventListener( 'mouseenter', function ( e ){ 1337 var not_uploaded = true; 1338 if(!this.classList.contains("mega-menu")){ 1339 1340 if( this.classList.contains("is-active") && this.classList.contains("is-uploaded")){ 1341 return; 1342 } 1343 1344 var item_el = this.closest('ul.mega-menu').querySelectorAll( 'li.menu-item' ); 1345 for (var i = 0; i < item_el.length; i++){ 1346 item_el[i].classList.remove('is-active'); 1347 } 1348 1349 this.classList.add("is-active"); 1350 1351 1352 1353 if( ! $(grid).find('.loader-overlay').length ){ 1354 $(grid).addClass('is-loading').append( node_str ); 1355 } 1356 1357 var $item_id = this.getAttribute('data-id'); 1358 setTimeout(function(){ 1359 $( grid ).find('.ajax_menu').removeClass('fadeIn-menu').hide(); 1360 1361 $( grid ).find("[data-url='" + $item_id + "']").stop().show(400, function(){ 1362 1363 jQuery(this).addClass('fadeIn-menu'); 1364 1365 1366 if($(grid).hasClass('is-loading')){ 1367 $(grid).removeClass('is-loading').find('.mega_menu_wrapper_overlay').remove(); 1368 } 1369 }); 1370 }, 500); 1371 1372 1373 }else{ 1374 var item_el = this.querySelectorAll( 'ul.mega-menu li.menu-item' ); 1375 for (var i = 0; i < item_el.length; i++){ 1376 if(item_el[i].classList.contains('is-active')){ 1377 $( grid ).find("[data-url='" + item_el[i].getAttribute('data-id') + "']").show().addClass('fadeIn-menu'); 1378 if($( grid ).find("[data-url='" + item_el[i].getAttribute('data-id') + "']").length == 0){ 1379 not_uploaded = true; 1380 }else{ 1381 not_uploaded = false; 1382 } 1383 1384 } 1385 } 1386 } 1387 1388 var item_menu = this; 1389 1390 if(!this.classList.contains("is-uploaded") && not_uploaded){ 1391 1392 // Create request 1393 request_data.id = parseInt(this.getAttribute('data-id')); 1394 request_data.posts_count = parseInt(this.getAttribute('data-posts-count')); 1395 request_data.action = 'wgl_mega_menu_load_ajax'; 1396 1397 e.preventDefault(); 1398 1399 if( megaMenuAjax && megaMenuAjax.readyState != 4 ){ 1400 megaMenuAjax.abort(); 1401 } 1402 1403 megaMenuAjax = $.ajax({ 1404 url : wgl_core.ajaxurl, 1405 type: 'post', 1406 data: request_data, 1407 beforeSend: function(response){ 1408 if( ! $(grid).find('.loader-overlay').length ){ 1409 $(grid).addClass('is-loading').append( node_str ); 1410 } 1411 }, 1412 success: function( response, status ){ 1413 item_menu.classList.add('is-uploaded'); 1414 1415 var response_container, new_items, identifier, response_wrapper; 1416 response_container = document.createElement( "div" ); 1417 response_wrapper = document.createElement( "div" ); 1418 response_wrapper.classList.add("ajax_menu"); 1419 1420 response_container.innerHTML = response; 1421 identifier = $( ".items_id", response_container ); 1422 1423 response_wrapper.setAttribute('data-url', $(identifier).data('identifier')); 1424 1425 new_items = $( response_wrapper ).append($('.item', response_container )); 1426 1427 $('.ajax_menu').removeClass('fadeIn-menu').hide(); 1428 new_items = new_items.hide(); 1429 $( grid ).append( new_items ); 1430 new_items.show().addClass('fadeIn-menu'); 1431 if(typeof jarallax === 'function'){ 1432 irecco_parallax_video(); 1433 }else{ 1434 jQuery.getScript(wgl_core.JarallaxPluginVideo, function() 1435 { 1436 jQuery.getScript(wgl_core.JarallaxPlugin, function() 1437 { 1438 }).always(function( s, Status ) { 1439 jQuery(grid).find('.parallax-video').each(function() { 1440 jQuery( this ).jarallax( { 1441 loop: true, 1442 speed: 1, 1443 videoSrc: jQuery( this ).data( 'video' ), 1444 videoStartTime: jQuery( this ).data( 'start' ), 1445 videoEndTime: jQuery( this ).data( 'end' ), 1446 } ); 1447 }); 1448 }); 1449 }); 1450 } 1451 }, 1452 error: function( response ){ 1453 item_menu.classList.remove('is-uploaded'); 1454 }, 1455 complete: function( response ){ 1456 $(grid).removeClass('is-loading').find('.mega_menu_wrapper_overlay').remove(); 1457 }, 1458 }); 1459 } 1460 1461 1462 }, false ); 1463 } 1464 }(jQuery)); 1465 1466 1467} 1468 1469 1470 1471function irecco_message_anim_init(){ 1472 jQuery('body').on('click', '.message_close_button', function(e){ 1473 jQuery(this).closest('.irecco_module_message_box.closable').slideUp(350); 1474 }) 1475} 1476 1477function irecco_mobile_header(){ 1478 var menu = jQuery('.wgl-mobile-header .mobile_nav_wrapper .primary-nav > ul'); 1479 1480 //Create plugin Mobile Menu 1481 (function($) { 1482 1483 $.fn.wglMobileMenu = function(options) { 1484 var defaults = { 1485 "toggleID" : ".mobile-hamburger-toggle", 1486 "switcher" : ".button_switcher", 1487 "back" : ".back", 1488 "overlay" : ".wgl-menu_overlay", 1489 "anchor" : ".menu-item > a[href*=\\#]" 1490 }; 1491 1492 if (this.length === 0) { return this; } 1493 1494 return this.each(function () { 1495 var wglMenu = {}, ds = $(this); 1496 var sub_menu = jQuery('.mobile_nav_wrapper .primary-nav > ul ul'); 1497 var m_width = jQuery('.mobile_nav_wrapper').data( "mobileWidth" ); 1498 var m_toggle = jQuery('.mobile-hamburger-toggle'); 1499 var body = jQuery('body'); 1500 1501 //Helper Menu 1502 var open = "is-active", 1503 openSubMenu = "show_sub_menu", 1504 mobile_on = "mobile_switch_on", 1505 mobile_switcher = "button_switcher"; 1506 1507 var init = function() { 1508 wglMenu.settings = $.extend({}, defaults, options); 1509 createButton(); 1510 showMenu(); 1511 addPerfectScroll(); 1512 }, 1513 showMenu = function(){ 1514 if (jQuery(window).width() <= m_width) {
1515 if (!m_toggle.hasClass( open )) { 1516 create_nav_mobile_menu(); 1517 } 1518 }else{ 1519 reset_nav_mobile_menu(); 1520 } 1521 }, 1522 create_nav_mobile_menu = function() { 1523 sub_menu.removeClass(openSubMenu); 1524 ds.hide().addClass(mobile_on); 1525 body.removeClass(mobile_on); 1526 }, 1527 reset_nav_mobile_menu = function() { 1528 sub_menu.removeClass(openSubMenu); 1529 body.removeClass(mobile_on); 1530 ds.show().removeClass(mobile_on); 1531 m_toggle.removeClass(open); 1532 jQuery('.' + mobile_switcher) .removeClass('is-active'); 1533 }, 1534 createButton = function() { 1535 ds.find('.menu-item-has-children').each(function() { 1536 jQuery(this).find('> a').append('<span class="'+ mobile_switcher +'"></span>'); 1537 }); 1538 }, 1539 addPerfectScroll = function() { 1540 new PerfectScrollbar('#wgl-perfect-container', { 1541 wheelSpeed: 6, 1542 suppressScrollX: true 1543 }); 1544 }, 1545 toggleMobileMenu = function(e) { 1546 //jQuery(m_toggle).toggleClass(open); 1547 ds.toggleClass(openSubMenu); 1548 body.toggleClass(mobile_on); 1549 }, 1550 hideSubMenu = function(e) { 1551 if (!jQuery('.button_switcher').is(e.target) && !jQuery(e.target).closest('.language-menu, .language-dropdown').length) { 1552 jQuery('.mobile_nav_wrapper .menu-item-has-children').find('.sub-menu').stop(true).slideUp(450).removeClass(openSubMenu); 1553 jQuery('.mobile_nav_wrapper .menu-item-has-children').find('.button_switcher').removeClass(open); 1554 1555 if (jQuery(e.target).closest('.wgl-mobile-header').length) { 1556 toggleMobileMenu(); 1557 } 1558 } 1559 }, 1560 showSubMenu = function(e) { 1561 e.preventDefault(); 1562 var item = jQuery(this).parents('li'); 1563 1564 if(!jQuery(this).hasClass(open)){ 1565 jQuery('.mobile_nav_wrapper .menu-item-has-children').not(item).find('.sub-menu').stop(true).slideUp(450).removeClass(openSubMenu); 1566 jQuery('.mobile_nav_wrapper .menu-item-has-children').not(item).find('.button_switcher').removeClass(open); 1567 jQuery('.mobile_nav_wrapper .menu-item-has-children').not(item).find('a[href*=\\#]').removeClass(open); 1568 1569 jQuery(this).parent().prev('.sub-menu').stop(true).slideDown(450).addClass(openSubMenu); 1570 jQuery(this).parent().next('.sub-menu').stop(true).slideDown(450).addClass(openSubMenu); 1571 }else{ 1572 jQuery(this).parent().prev('.sub-menu').stop(true).slideUp(450).removeClass(openSubMenu); 1573 jQuery(this).parent().next('.sub-menu').stop(true).slideUp(450).removeClass(openSubMenu); 1574 } 1575 1576 jQuery(this).toggleClass(open); 1577 }, 1578 eventClose = function(e) { 1579 var container = $("#wgl-perfect-container"); 1580 1581 if (!container.is(e.target) && container.has(e.target).length === 0 && !jQuery(e.target).closest('.language-menu, .language-dropdown').length) { 1582 if ($('body').hasClass(mobile_on)) { 1583 toggleMobileMenu(); 1584 } 1585 } 1586 }, 1587 goBack = function(e) { 1588 e.preventDefault(); 1589 jQuery(this).closest( '.sub-menu' ).removeClass(openSubMenu); 1590 jQuery(this).closest( '.sub-menu' ).prev( 'a' ).removeClass(open); 1591 jQuery(this).closest( '.sub-menu' ).prev( 'a' ).find('.' + mobile_switcher).removeClass(open); 1592 }; 1593 1594 /*Init*/ 1595 init(); 1596 1597 jQuery(wglMenu.settings.toggleID).on(click, toggleMobileMenu); 1598 jQuery(wglMenu.settings.overlay).on(click, eventClose); 1599 1600 //switcher menu 1601 jQuery(wglMenu.settings.switcher).on(click, showSubMenu); 1602 jQuery(wglMenu.settings.anchor).on(click, hideSubMenu); 1603 1604 //Go back menu 1605 jQuery(wglMenu.settings.back).on(click, goBack); 1606 1607 jQuery( window ).resize( 1608 function() { 1609 showMenu(); 1610 } 1611 ); 1612 }); 1613 1614 }; 1615 })(jQuery); 1616 1617 menu.wglMobileMenu(); 1618 1619} 1620// wgl Page Title Parallax 1621function irecco_page_title_parallax() { 1622 var page_title = jQuery('.page-header.page_title_parallax') 1623 if (page_title.length !== 0 ) { 1624 page_title.paroller(); 1625 } 1626} 1627 1628// wgl Extended Parallax 1629function irecco_extended_parallax() { 1630 var item = jQuery('.extended-parallax') 1631 if (item.length !== 0 ) { 1632 item.each( function() { 1633 jQuery(this).paroller(); 1634 }) 1635 } 1636} 1637// wgl Portfolio Single Parallax 1638function irecco_portfolio_parallax() { 1639 var portfolio = jQuery('.wgl-portfolio-item_bg.portfolio_parallax') 1640 if (portfolio.length !== 0 ) { 1641 portfolio.paroller(); 1642 } 1643} 1644 1645function irecco_parallax_video () { 1646 jQuery( '.parallax-video' ).each( function() { 1647 jQuery( this ).jarallax( { 1648 loop: true, 1649 speed: 1, 1650 videoSrc: jQuery( this ).data( 'video' ), 1651 videoStartTime: jQuery( this ).data( 'start' ), 1652 videoEndTime: jQuery( this ).data( 'end' ), 1653 } ); 1654 } ); 1655} 1656function particles_custom () { 1657 jQuery('.particles-js').each(function () { 1658 var id = jQuery(this).attr('id'); 1659 var type = jQuery(this).data('particles-type'); 1660 var color_type = jQuery(this).data('particles-colors-type'); 1661 var color = jQuery(this).data('particles-color'); 1662 var color_line = jQuery(this).data('particles-color'); 1663 var number = jQuery(this).data('particles-number'); 1664 var lines = jQuery(this).data('particles-line'); 1665 var size = jQuery(this).data('particles-size'); 1666 var speed = jQuery(this).data('particles-speed'); 1667 var hover = jQuery(this).data('particles-hover'); 1668 var hover_mode = jQuery(this).data('particles-hover-mode'); 1669 switch (type) { 1670 case 'particles': 1671 type = 'circle'; 1672 break; 1673 case 'hexagons': 1674 type = 'polygon'; 1675 break; 1676 default: 1677 type = 'circle'; 1678 break; 1679 } 1680 if (color_type == 'random_colors') { 1681 color = color.split(','); 1682 color_line = color[0] 1683 } 1684 1685 particlesJS( 1686 id, { 1687 "particles":{ 1688 "number":{ 1689 "value":number, 1690 "density":{ 1691 "enable":true, 1692 "value_area":800 1693 } 1694 }, 1695 "color":{ 1696 "value": color 1697 }, 1698 "shape":{ 1699 "type":type, 1700 "polygon":{ 1701 "nb_sides":6 1702 }, 1703 }, 1704 "opacity":{ 1705 "value":1, 1706 "random":true, 1707 "anim":{ 1708 "enable":false, 1709 "speed":1, 1710 "opacity_min":0.1, 1711 "sync":false 1712 } 1713 }, 1714 "size":{ 1715 "value":size, 1716 "random":true, 1717 "anim":{ 1718 "enable":false, 1719 "speed":30, 1720 "size_min": 1, 1721 "sync":false 1722 } 1723 }, 1724 "line_linked":{ 1725 "enable":lines, 1726 "distance":150, 1727 "color":color_line, 1728 "opacity":0.4, 1729 "width":1 1730 }, 1731 "move":{ 1732 "enable":true, 1733 "speed":speed, 1734 "direction":"none", 1735 "random":false, 1736 "straight":false, 1737 "out_mode":"out", 1738 "bounce":false, 1739 "attract":{ 1740 "enable":false, 1741 "rotateX":600, 1742 "rotateY":1200 1743 } 1744 } 1745 }, 1746 "interactivity":{ 1747 "detect_on":"canvas", 1748 "events":{ 1749 "onhover":{ 1750 "enable":hover, 1751 "mode":hover_mode 1752 }, 1753 "onclick":{ 1754 "enable":true, 1755 "mode":"push" 1756 }, 1757 "resize":true 1758 }, 1759 "modes":{ 1760 "grab":{ 1761 "distance":150, 1762 "line_linked":{ 1763 "opacity":1 1764 } 1765 }, 1766 "bubble":{ 1767 "distance":200, 1768 "size":size*1.6, 1769 "duration":20, 1770 "opacity":1, 1771 "speed":30 1772 }, 1773 "repulse":{ 1774 "distance":80, 1775 "duration":0.4 1776 }, 1777 "push":{"particles_nb":4}, 1778 "remove":{"particles_nb":2} 1779 } 1780 }, 1781 "retina_detect":true 1782 }); 1783 var update; 1784 update = function() { 1785 requestAnimationFrame(update); 1786 }; 1787 requestAnimationFrame(update); 1788 }) 1789} 1790//http://brutaldesign.github.io/swipebox/ 1791function irecco_videobox_init () { 1792 var gallery = jQuery(".videobox, .swipebox, .gallery a[href$='.jpg'], .gallery a[href$='.jpeg'], .gallery a[href$='.JPEG'], .gallery a[href$='.gif'], .gallery a[href$='.png']"); 1793 if (gallery.length !== 0 ) { 1794 gallery.each(function() { 1795 jQuery(this).attr('data-elementor-open-lightbox', 'yes'); 1796 }); 1797 } 1798} 1799// wgl Progress Bars 1800function irecco_progress_bars_init(e) { 1801 1802 var item = jQuery('.wgl-progress_bar'); 1803 1804 if (item.length) { 1805 item.each(function() { 1806 var item = jQuery(this), 1807 slidable_label = false, 1808 item_label = item.find('.progress_label_wrap'), 1809 bar = item.find('.progress_bar'), 1810 data_width = bar.data('width'), 1811 counter = item.find('.progress_value'), 1812 duration = parseFloat(bar.css('transition-duration'))*1000, 1813 interval = Math.floor(duration/data_width), 1814 temp = 0; 1815 if (item.hasClass('dynamic-value')) { 1816 slidable_label = true; 1817 } 1818 if(!e){ 1819 item.appear(function() { 1820 bar.css('width',data_width+'%'); 1821 if ( slidable_label == true ) { 1822 item_label.css('width', data_width+'%'); 1823 } 1824 var recap = setInterval( function() { 1825 counter.text(temp); 1826 temp++; 1827 }, interval); 1828 var stopCounter = setTimeout(function() { 1829 clearInterval(recap); 1830 counter.text(data_width); 1831 }, duration); 1832 }); 1833 } else { 1834 bar.css('width',data_width+'%'); 1835 if ( slidable_label ) { 1836 item_label.css('width', data_width+'%'); 1837 } 1838 var recap = setInterval( function() { 1839 counter.text(temp); 1840 temp++; 1841 }, interval); 1842 var stopCounter = setTimeout(function() { 1843 clearInterval(recap); 1844 counter.text(data_width); 1845 }, duration); 1846 } 1847 }); 1848 } 1849} 1850function irecco_search_init() { 1851 1852 // Create plugin Search 1853 (function($) { 1854 1855 $.fn.wglSearch = function(options) { 1856 var defaults = { 1857 "toggleID" : ".header_search-button", 1858 "closeID" : ".header_search-close", 1859 "searchField" : ".header_search-field", 1860 "body" : "body > *:not(header)", 1861 }; 1862 1863 if (this.length === 0) { return this; } 1864 1865 return this.each(function() { 1866 var wglSearch = {}, 1867 s = $(this), 1868 openClass = 'header_search-open', 1869 searchClass = '.header_search', 1870 1871 init = function() { 1872 wglSearch.settings = $.extend({}, defaults, options); 1873 }, 1874 open = function() { 1875 $(s).addClass(openClass); 1876 setTimeout(function() { 1877 $(s).find('input.search-field').focus(); 1878 }, 100); 1879 return false;
1880 }, 1881 close = function() { 1882 jQuery(s).removeClass(openClass); 1883 }, 1884 toggleSearch = function(e) { 1885 if (! $(s).closest(searchClass).hasClass(openClass)) { 1886 open(); 1887 } else { 1888 close(); 1889 } 1890 }, 1891 eventClose = function(e) { 1892 if (! $(e.target).closest('.search-form').length) { 1893 if (jQuery(searchClass).hasClass(openClass)) { 1894 close(); 1895 } 1896 } 1897 }; 1898 1899 // Init 1900 init(); 1901 1902 if (jQuery(this).hasClass('search_standard')) { 1903 jQuery(this).find(wglSearch.settings.toggleID).on(click, toggleSearch); 1904 jQuery(this).find(wglSearch.settings.closeID).on(click, eventClose); 1905 } else { 1906 jQuery(wglSearch.settings.toggleID).on(click, toggleSearch); 1907 jQuery(wglSearch.settings.searchField).on(click, eventClose); 1908 } 1909 1910 jQuery(wglSearch.settings.body).on(click, eventClose); 1911 1912 }); 1913 1914 }; 1915 1916 })(jQuery); 1917 1918 jQuery('.header_search').wglSearch(); 1919 1920} 1921// Select Wrapper 1922function irecco_select_wrap() { 1923 jQuery( '.widget select, .select.wpcf7-select, .woocommerce .woocommerce-ordering select' ) 1924 .each( function() { 1925 jQuery( this ).wrap( "<div class='select__field'></div>" ); 1926 } 1927 ); 1928} 1929function irecco_side_panel_init() { 1930 1931 // Create plugin Side Panel 1932 (function($) { 1933 1934 $.fn.wglSidePanel = function(options) { 1935 var defaults = { 1936 "toggleID" : ".side_panel-toggle", 1937 "closeID" : ".side-panel_close", 1938 "closeOverlay" : ".side-panel_overlay", 1939 "body" : "body > *:not(header)", 1940 "sidePanel" : "#side-panel .side-panel_sidebar" 1941 }; 1942 1943 if (this.length === 0) { return this; } 1944 1945 return this.each(function () { 1946 var wglSidePanel = {}, 1947 s = $(this), 1948 openClass = 'side-panel_open', 1949 wglScroll, 1950 sidePanelClass = '.side_panel', 1951 1952 init = function() { 1953 wglSidePanel.settings = $.extend({}, defaults, options); 1954 }, 1955 open = function () { 1956 if (! $('#side-panel').hasClass('side-panel_active')) { 1957 $('#side-panel').addClass('side-panel_active'); 1958 } 1959 1960 $('#side-panel').addClass(openClass); 1961 $(s).addClass(openClass); 1962 $('body').removeClass('side-panel--closed').addClass('side-panel--opened'); 1963 1964 var wglClassAnimated = $('#side-panel').find('section.elementor-element').data('settings'); 1965 if (wglClassAnimated && wglClassAnimated.animation) { 1966 $('#side-panel').find('section.elementor-element').removeClass('elementor-invisible').addClass('animated').addClass(wglClassAnimated.animation); 1967 } 1968 }, 1969 close = function () { 1970 $(s).removeClass(openClass); 1971 $('#side-panel').removeClass(openClass); 1972 $('body').removeClass('side-panel--opened').addClass('side-panel--closed'); 1973 var wglClassAnimated = $('#side-panel').find('section.elementor-element').data('settings'); 1974 if (wglClassAnimated && wglClassAnimated.animation) { 1975 $('#side-panel').find('section.elementor-element').removeClass(wglClassAnimated.animation); 1976 } 1977 }, 1978 togglePanel = function(e) { 1979 e.preventDefault(); 1980 wglScroll = $(window).scrollTop(); 1981 1982 if (! $(s).closest(sidePanelClass).hasClass(openClass)) { 1983 open(); 1984 jQuery(window).scroll(function() { 1985 if (450 < Math.abs(jQuery(this).scrollTop() - wglScroll)) { 1986 close(); 1987 } 1988 }); 1989 } else { 1990 1991 } 1992 }, 1993 closePanel = function(e) { 1994 e.preventDefault(); 1995 if ($(s).closest(sidePanelClass).hasClass(openClass)) { 1996 close(); 1997 } 1998 }, 1999 eventClose = function(e) { 2000 var element = $(sidePanelClass), 2001 container = $("#side-panel"); 2002 2003 if (! container.is(e.target) && container.has(e.target).length === 0) { 2004 if ($(element).hasClass(openClass)) { 2005 close(); 2006 } 2007 } 2008 }; 2009 2010 // Init 2011 init(); 2012 2013 jQuery(wglSidePanel.settings.toggleID).on(click, togglePanel); 2014 jQuery(wglSidePanel.settings.body).on(click, eventClose); 2015 jQuery(wglSidePanel.settings.closeID).on(click, closePanel); 2016 jQuery(wglSidePanel.settings.closeOverlay).on(click, closePanel); 2017 2018 new PerfectScrollbar('#side-panel', { 2019 wheelSpeed: 6, 2020 suppressScrollX: true 2021 }); 2022 }); 2023 2024 }; 2025 2026 })(jQuery); 2027 2028 if (jQuery('#side-panel').length) { 2029 jQuery('.side_panel').wglSidePanel(); 2030 } 2031} 2032function irecco_skrollr_init(){ 2033 var blog_scroll = jQuery('.blog_skrollr_init'); 2034 if (blog_scroll.length) {
2035 if(!(/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera)){ 2036 // wgl Skrollr 2037 skrollr.init({ 2038 smoothScrolling: false, 2039 forceHeight: false 2040 }); 2041 } 2042 } 2043} 2044 2045function irecco_split_slider() { 2046 2047 var split_slider = jQuery('.irecco_module_split_slider'); 2048 if ( split_slider.length ) { 2049 2050 split_slider.each(function() { 2051 jQuery(this).height(jQuery(window).height()).addClass('slider_initialized'); 2052 2053 jQuery(this).multiscroll({ 2054 easing: 'easeInOutQuart', 2055 navigation: true, 2056 sectionSelector: '.irecco_split_slider-section', 2057 leftSelector: '.irecco_split_slider-left', 2058 rightSelector: '.irecco_split_slider-right', 2059 afterRender: function () { 2060 var cloneLeft = jQuery(this).closest('.irecco_split_slider-left > .irecco_split_slider-section'); 2061 var cloneRight = jQuery(this).closest('.irecco_split_slider-right > .irecco_split_slider-section'); 2062 cloneRight = Array.prototype.reverse.apply(cloneRight); 2063 2064 var responsive = jQuery(this).closest('.irecco_module_split_slider-wrapper').find('.irecco_module_split_slider-responsive'); 2065 for(var i = 0; i < cloneLeft.length; i++){ 2066 jQuery(responsive).append(jQuery(cloneLeft[i]).clone(true)); 2067 jQuery(responsive).append(jQuery(cloneRight[i]).clone(true)); 2068 } 2069 jQuery('body').addClass('ms-initialized'); 2070 irecco_progress_bars_init(true); 2071 } 2072 }); 2073 }); 2074 2075 if (jQuery(window).width() <= 1024) { 2076 jQuery.fn.multiscroll.destroy(); 2077 } else { 2078 jQuery.fn.multiscroll.build(); 2079 } 2080 2081 jQuery(window).resize(function () { 2082 if (jQuery(window).width() <= 1024) { 2083 jQuery.fn.multiscroll.destroy(); 2084 } else { 2085 jQuery.fn.multiscroll.build(); 2086 } 2087 2088 }); 2089 } 2090} 2091 2092function irecco_sticky_init() { 2093 2094 var section = '.wgl-sticky-header', 2095 header_height = '.wgl-site-header', 2096 top = jQuery(header_height).height(), 2097 data = jQuery(section).data('style'), 2098 previousScroll = 0; 2099 2100 function init(element) { 2101 if ( ! element ) { 2102 return; 2103 } 2104 2105 var y = jQuery(window).scrollTop(); 2106 if ( data == 'standard' ) { 2107 2108 if ( y >= top ) { 2109 jQuery(section).addClass( 'sticky_active' ); 2110 } else { 2111 jQuery(section).removeClass( 'sticky_active' ); 2112 } 2113 2114 } else { 2115 if ( y > top ) { 2116 if ( y > previousScroll ) { 2117 jQuery(section).removeClass( 'sticky_active' ); 2118 } else { 2119 jQuery(section).addClass( 'sticky_active' ); 2120 } 2121 } else { 2122 jQuery(section).removeClass('sticky_active'); 2123 } 2124 previousScroll = y; 2125 2126 } 2127 }; 2128 2129 if ( jQuery( '.wgl-sticky-header' ).length !== 0 ) { 2130 jQuery( window ).scroll( function() { 2131 init(jQuery(this)); 2132 } ); 2133 2134 jQuery( window ).resize( function() { 2135 init(jQuery(this)); 2136 } ); 2137 } 2138} 2139function irecco_sticky_sidebar() { 2140 if (jQuery('.sticky-sidebar').length) { 2141 jQuery('body').addClass('sticky-sidebar_init'); 2142 jQuery('.sticky-sidebar').each(function() { 2143 jQuery(this).theiaStickySidebar({ 2144 additionalMarginTop: 130, 2145 additionalMarginBottom: 30 2146 }); 2147 }); 2148 } 2149 2150 if (jQuery('.sticky_layout .info-wrapper').length) { 2151 jQuery('.sticky_layout .info-wrapper').each(function() { 2152 jQuery(this).theiaStickySidebar({ 2153 additionalMarginTop: 150, 2154 additionalMarginBottom: 150 2155 }); 2156 }); 2157 } 2158} 2159 2160function irecco_striped_services_init() { 2161 var item_wrap = jQuery('.wgl-striped-services'); 2162 2163 if (item_wrap.length) { 2164 item_wrap.each(function() { 2165 var item = jQuery(this).find('.service-item'); 2166 2167 item.on('mouseenter', function(e) { 2168 item_wrap.addClass('onhover'); 2169 jQuery(this).addClass('active'); 2170 }); 2171 item.on('mouseleave', function(e) { 2172 item_wrap.removeClass('onhover'); 2173 jQuery(this).removeClass('active'); 2174 }); 2175 }); 2176 } 2177} 2178 2179// Tabs 2180function irecco_tabs_init() { 2181 if (jQuery('.wgl-tabs').length) { 2182 jQuery('.wgl-tabs').each(function(){ 2183 var $this = jQuery(this); 2184 2185 var tab = $this.find('.wgl-tabs_headings .wgl-tabs_header'); 2186 var data = $this.find('.wgl-tabs_content-wrap .wgl-tabs_content'); 2187 2188 tab.filter(':first').addClass('active'); 2189 2190 data.filter(':not(:first)').hide(); 2191 tab.each(function(){ 2192 var currentTab = jQuery(this); 2193 2194 currentTab.on('click tap', function(){ 2195 var id = currentTab.data('tab-id'); 2196 2197 currentTab.addClass('active').siblings().removeClass('active'); 2198 jQuery('.wgl-tabs .wgl-tabs_content[data-tab-id='+id+']').slideDown().siblings().slideUp(); 2199 }); 2200 }); 2201 }) 2202 } 2203}
2203 2204 2205function irecco_text_background() { 2206 2207 var anim_text = jQuery('.wgl-animation-background-text'); 2208 if ( anim_text.length ) { 2209 2210 2211 anim_text.each(function(index){ 2212 var paralax_text = jQuery('<div class="wgl-background-text"/>'); 2213 2214 jQuery(this).find(">div:eq(0)").before(paralax_text); 2215 var text = window.getComputedStyle(this,':before').content; 2216 2217 text = text.slice(1, -1); 2218 2219 paralax_text.addClass('element-'+ index); 2220 paralax_text.attr('data-info', index); 2221 2222 jQuery(this).find(paralax_text).html(text.replace(/([^\x00-\x80]|\w)/g, "<span class='letter'>$&</span>")); 2223 2224 var self = jQuery(this); 2225 2226 anim_text.appear(function() { 2227 2228 if(typeof anime === 'function'){ 2229 2230 var item_anime = jQuery(this).find('.wgl-background-text').data('info'); 2231 2232 if(item_anime === index){ 2233 anime.timeline({loop: false}) 2234 .add({ 2235 targets: '.element-'+ index + ' .letter', 2236 translateY: [100,0], 2237 translateZ: 0, 2238 opacity: [0,1], 2239 easing: "easeOutExpo", 2240 duration: 1400, 2241 delay: function(el, i) { 2242 return 0 + 350 * i; 2243 } 2244 }); 2245 } 2246 2247 2248 } 2249 }); 2250 2251 2252 }); 2253 } 2254} 2255// WGL Time Line Vertical appear 2256function irecco_init_timeline_appear() { 2257 2258 var item = jQuery('.wgl-timeline-vertical.appear_anim .time_line-item'); 2259 2260 if (item.length) { 2261 item.each(function() { 2262 var item = jQuery(this); 2263 item.appear(function() { 2264 item.addClass('item_show'); 2265 }); 2266 }); 2267 } 2268} 2269function irecco_woocommerce_helper(){ 2270 jQuery('body').on('click', '.quantity.number-input span.minus', function(e){ 2271 this.parentNode.querySelector('input[type=number]').stepDown(); 2272 if(document.querySelector('.woocommerce-cart-form [name=update_cart]')){ 2273 document.querySelector('.woocommerce-cart-form [name=update_cart]').disabled = false; 2274 } 2275 }); 2276 2277 jQuery('body').on('click', '.quantity.number-input span.plus', function(e){ 2278 this.parentNode.querySelector('input[type=number]').stepUp(); 2279 if(document.querySelector('.woocommerce-cart-form [name=update_cart]')){ 2280 document.querySelector('.woocommerce-cart-form [name=update_cart]').disabled = false; 2281 } 2282 }); 2283 2284 jQuery('ul.wgl-products li a.add_to_cart_button.ajax_add_to_cart').on( "click", function() { 2285 jQuery(this).closest('li').addClass('added_to_cart_item'); 2286 }); 2287} 2288 2289function irecco_woocommerce_login_in() { 2290 2291 if (jQuery('header .login-in').length) { 2292 var mc = jQuery('header .login-in'), 2293 icon = mc.find('a.login-in_link'), 2294 overlay = mc.find('div.overlay'); 2295 2296 icon.on('click tap', function(e) { 2297 e.preventDefault(); 2298 mc.toggleClass('open_login'); 2299 }); 2300 2301 overlay.on('click tap', function(e) { 2302 if(!jQuery(e.target).closest('.modal_content').length && !jQuery(e.target).is('.modal_content')){ 2303 mc.removeClass('open_login'); 2304 } 2305 }); 2306 2307 }; 2308}; 2309 2310 2311function irecco_woocommerce_mini_cart() { 2312 2313 if (jQuery('header .mini-cart').length) { 2314 jQuery('header .mini-cart').prepend('<div class="mini_cart-overlay"></div>'); 2315 2316 var mc = jQuery('header .mini-cart'), 2317 icon = mc.find('a.woo_icon'), 2318 overlay = mc.find('div.mini_cart-overlay'); 2319 2320 icon.on('click tap', function() { mc.toggleClass('open_cart'); }); 2321 overlay.on('click tap', function() { mc.removeClass('open_cart'); }); 2322 jQuery('body').on('click', 'header a.close_mini_cart', function(){ 2323 mc.removeClass('open_cart'); 2324 }); 2325 }; 2326};
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.