// Vimeo Vieo Function Bozu_Vimeo(); function Bozu_Vimeo(){ /*! vimeo-jquery-api 2016-05-05 */ !function(a,b){var c={catchMethods:{methodreturn:[],count:0},init:function(b){;var c,d,e;b.originalEvent.origin.match(/vimeo/gi)&&"data"in b.originalEvent&&(e="string"===a.type(b.originalEvent.data)?a.parseJSON(b.originalEvent.data):b.originalEvent.data,e&&(c=this.setPlayerID(e),c.length&&(d=this.setVimeoAPIurl(c),e.hasOwnProperty("event")&&this.handleEvent(e,c,d),e.hasOwnProperty("method")&&this.handleMethod(e,c,d))))},setPlayerID:function(b){return a("iframe[src*="+b.player_id+"]")},setVimeoAPIurl:function(a){return"http"!==a.attr("src").substr(0,4)?"https:"+a.attr("src").split("?")[0]:a.attr("src").split("?")[0]},handleMethod:function(a){this.catchMethods.methodreturn.push(a.value)},handleEvent:function(b,c,d){switch(b.event.toLowerCase()){case"ready":for(var e in a._data(c[0],"events"))e.match(/loadProgress|playProgress|play|pause|finish|seek|cuechange/)&&c[0].contentWindow.postMessage(JSON.stringify({method:"addEventListener",value:e}),d);if(c.data("vimeoAPICall")){for(var f=c.data("vimeoAPICall"),g=0;g', prevArrow: '', dots: false, rtl: rtled, }); }); $(".testimonial-slider").each(function () { $(this).slick({ slidesToShow: 1, slidesToScroll: 1, fade: true, autoplay: false, autoplaySpeed: 8000, infinite: true, prevArrow: false, nextArrow: false, dots: true, rtl: rtled, }); }); $(".main-slider").each(function () { $(this).slick({ slidesToShow: 1, slidesToScroll: 1, fade: true, autoplay: false, autoplaySpeed: 8000, infinite: true, prevArrow: false, nextArrow: false, dots: true, rtl: rtled, }); }); $(".theme-recommended-slider").each(function () { $(this).slick({ infinite: true, speed: 300, slidesToShow: 3, slidesToScroll: 1, autoplay: false, autoplaySpeed: 8000, arrows : false, responsive: [ { breakpoint: 991, settings: { slidesToShow: 2 } }, { breakpoint: 480, settings: { slidesToShow: 1 } } ] }); }); // Content Gallery End // Content Gallery popup Start $('.entry-content .gallery, .widget .gallery, .wp-block-gallery, .zoom-gallery').each(function () { $(this).magnificPopup({ delegate: 'a', type: 'image', closeOnContentClick: false, closeBtnInside: false, mainClass: 'mfp-with-zoom mfp-img-mobile', image: { verticalFit: true, titleSrc: function (item) { return item.el.attr('title'); } }, gallery: { enabled: true }, zoom: { enabled: true, duration: 300, opener: function (element) { return element.find('img'); } } }); }); // Content Gallery popup End function bozu_masonry(){ $('.theme-panelarea-blocks').addClass('twp-active-masonry'); // Masonry Grid if ($('.theme-panelarea-blocks').length > 0) { var rtl = false; var oLeft = true; if( $( 'body' ).hasClass('rtl') ){ var rtl = true; var oLeft = false; } /*Default masonry animation*/ var grid; var hidden = 'scale(0.5)'; var visible = 'scale(1)'; grid = $('.theme-panelarea-blocks').imagesLoaded(function () { grid.masonry({ itemSelector: '.theme-panel-blocks', isRTL: rtl, originLeft: oLeft, hiddenStyle: { transform: hidden, opacity: 0 }, visibleStyle: { transform: visible, opacity: 1 } }); }); } } // Masanory if ($(window).width() > 991) { bozu_masonry(); } // Masanory on resize $( window ).resize(function() { if ( $(window).width() < 991 && $('.theme-panelarea-blocks').hasClass('twp-active-masonry') ) { $('.theme-panelarea-blocks').masonry( 'destroy' ); $('.theme-panelarea-blocks').removeClass('twp-active-masonry'); } if ( $(window).width() > 991 && !$('.theme-panelarea-blocks').hasClass('twp-active-masonry') ){ bozu_masonry(); } }); // Navigation toggle on scroll $(window).scroll(function () { if ($(window).scrollTop() > $(window).height() / 2) { $('.scroll-up').addClass('enable-scroll-up'); } else { $('.scroll-up').removeClass('enable-scroll-up'); } if( $(window).scrollTop() > $(window).height() / 2 ){ $('body').addClass('theme-floatingbar-active'); }else{ $('body').removeClass('theme-floatingbar-active'); } }); // Scroll to Top on Click $('.scroll-up').click(function () { $("html, body").animate({ scrollTop: 0 }, 800); return false; }); // Widgets Tab $('.twp-nav-tabs .tab').on('click', function (event) { var tabid = $(this).attr('tab-data'); $(this).closest('.tabbed-container').find('.tab').removeClass('active'); $(this).addClass('active'); $(this).closest('.tabbed-container').find('.tab-content .tab-pane').removeClass('active'); $(this).closest('.tabbed-container').find('.content-' + tabid).addClass('active'); }); }); /* ----------------------------------------------------------------------------------------------- Intrinsic Ratio Embeds --------------------------------------------------------------------------------------------------- */ var Bozu = Bozu || {}, $ = jQuery; var $bozu_doc = $(document), $bozu_win = $(window), viewport = {}; viewport.top = $bozu_win.scrollTop(); viewport.bottom = viewport.top + $bozu_win.height(); Bozu.instrinsicRatioVideos = { init: function () { Bozu.instrinsicRatioVideos.makeFit(); $bozu_win.on('resize fit-videos', function () { Bozu.instrinsicRatioVideos.makeFit(); }); }, makeFit: function () { var vidSelector = "iframe, .format-video object, .format-video video"; $(vidSelector).each(function () { var $bozu_video = $(this), $bozu_container = $bozu_video.parent(), bozu_iTargetWidth = $bozu_container.width(); // Skip videos we want to ignore if ($bozu_video.hasClass('intrinsic-ignore') || $bozu_video.parent().hasClass('intrinsic-ignore')) { return true; } if (!$bozu_video.attr('data-origwidth')) { // Get the video element proportions $bozu_video.attr('data-origwidth', $bozu_video.attr('width')); $bozu_video.attr('data-origheight', $bozu_video.attr('height')); } // Get ratio from proportions var bozu_ratio = bozu_iTargetWidth / $bozu_video.attr('data-origwidth'); // Scale based on ratio, thus retaining proportions $bozu_video.css('width', bozu_iTargetWidth + 'px'); $bozu_video.css('height', ($bozu_video.attr('data-origheight') * bozu_ratio) + 'px'); }); } }; $bozu_doc.ready(function () { Bozu.instrinsicRatioVideos.init(); // Retain aspect ratio of videos on window resize });