jQuery(function() { "use strict"; /*================*/ /* 01 - VARIABLES */ /*================*/ var swipers = [], winW, winH, winScr, _isresponsive, smPoint = 767, mdPoint = 992, lgPoint = 1200, addPoint = 1600, _ismobile = navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i), tabFinish = 0; /*========================*/ /* 02 - page calculations */ /*========================*/ function pageCalculations(){ winW = jQuery(window).width(); winH = jQuery(window).height(); if(jQuery('.menu-button').is(':visible')) _isresponsive = true; else _isresponsive = false; } /*=================================*/ /* 03 - function on document ready */ /*=================================*/ pageCalculations(); /*============================*/ /* 04 - WINDOW LOAD */ /*============================*/ jQuery(window).load(function(){ jQuery('#loader').fadeOut(); initSwiper(); if(jQuery('.container-masonry').length) { jQuery('.container-masonry').masonry({ itemSelector: '.item-masonry', columnWidth: '.item-masonry' }); }; }); /*============================*/ /* 04 - WINDOW SCROLL */ /*============================*/ jQuery(window).on('scroll load', function () { if( jQuery('.time-line').length) { jQuery('.time-line').not('.animated').each(function(){ if(jQuery(window).scrollTop() + jQuery(window).height() > jQuery(this).offset().top){ jQuery(this).addClass('animated').find('.count-amount').countTo(); } }); } if( jQuery('.progress-item').length) { jQuery('.progress-item').not(".progress-animate").each(function () { var elmentPosition = jQuery(this).offset().top, topOfWindow = jQuery(window).scrollTop(), progressTo = jQuery(this).find('.progress-to').data('to'); if (topOfWindow + jQuery(window).height() > elmentPosition) { jQuery(this).addClass("progress-animate").find('.progress-to').countTo(); jQuery(this).find('.progress-line-current').width(progressTo + '%'); } }); } if( jQuery('.chart-box').length) { jQuery('.chart-box').each(function () { var elmentPosition = jQuery(this).offset().top, topOfWindow = jQuery(window).scrollTop(); if (topOfWindow + jQuery(window).height() > elmentPosition) { jQuery(this).find('.chart').easyPieChart({ easing: 'easeOutBounce', barColor: '#0085ba', trackColor: '#f7f7f7', lineWidth: 5, scaleColor: 'transparent', onStep: function (from, to, percent) { jQuery(this.el).find('.percent').text(Math.round(percent)); } }); } }); } if(jQuery(window).scrollTop() > 500) { jQuery('.scroll-top').addClass('active'); }else { jQuery('.scroll-top').removeClass('active'); } if(jQuery(window).scrollTop() > 80) { jQuery('.header').addClass('fixed'); }else { jQuery('.header').removeClass('fixed'); } }); /*==============================*/ /* 05 - function on page resize */ /*==============================*/ function resizeCall(){ pageCalculations(); jQuery('.swiper-container.initialized[data-slides-per-view="responsive"]').each(function(){ var thisSwiper = swipers['swiper-'+jQuery(this).attr('id')], $t = jQuery(this), slidesPerViewVar = updateSlidesPerView($t), centerVar = thisSwiper.params.centeredSlides; thisSwiper.params.slidesPerView = slidesPerViewVar; thisSwiper.reInit(); if(!centerVar){ var paginationSpan = $t.find('.pagination span'); var paginationSlice = paginationSpan.hide().slice(0,(paginationSpan.length+1-slidesPerViewVar)); if(paginationSlice.length<=1 || slidesPerViewVar>=$t.find('.swiper-slide').length) $t.addClass('pagination-hidden'); else $t.removeClass('pagination-hidden'); paginationSlice.show(); } }); } if(!_ismobile){ jQuery(window).resize(function(){ resizeCall(); }); } else { window.addEventListener("orientationchange", function() { resizeCall(); }, false); } /*=====================*/ /* 07 - swiper sliders */ /*=====================*/ function initSwiper(){ var initIterator = 0; jQuery('.swiper-container').each(function(){ var $t = jQuery(this); var index = 'swiper-unique-id-'+initIterator; $t.addClass('swiper-'+index + ' initialized').attr('id', index); $t.find('.pagination').addClass('pagination-'+index); var autoPlayVar = parseInt($t.attr('data-autoplay')); var centerVar = parseInt($t.attr('data-center')); var simVar = ($t.closest('.circle-description-slide-box').length)?false:true; var slidesPerViewVar = $t.attr('data-slides-per-view'); if(slidesPerViewVar == 'responsive'){ slidesPerViewVar = updateSlidesPerView($t); } else slidesPerViewVar = parseInt(slidesPerViewVar); var loopVar = parseInt($t.attr('data-loop')); var speedVar = parseInt($t.attr('data-speed')); swipers['swiper-'+index] = new Swiper('.swiper-'+index,{ speed: speedVar, pagination: '.pagination-'+index, loop: loopVar, paginationClickable: true, autoplay: autoPlayVar, slidesPerView: slidesPerViewVar, keyboardControl: true, calculateHeight: true, simulateTouch: simVar, centeredSlides: centerVar, roundLengths: true, onInit: function(swiper){ var activeIndex = (loopVar===true)?swiper.activeIndex:swiper.activeLoopIndex; if($t.closest('.testi-slider').length){ $t.css({ height: $t.find('.swiper-slide').eq(activeIndex).height() }); } }, onSlideChangeEnd: function(swiper){ var activeIndex = (loopVar===1)?swiper.activeLoopIndex:swiper.activeIndex; var qVal = $t.find('.swiper-slide-active').attr('data-val'); $t.find('.swiper-slide[data-val="'+qVal+'"]').addClass('active'); }, onSlideChangeStart: function(swiper){ var activeIndex = (loopVar===true)?swiper.activeIndex:swiper.activeLoopIndex; $t.find('.swiper-slide.active').removeClass('active'); if($t.closest('.testi-slider').length){ $t.css({ height: $t.find('.swiper-slide').eq(activeIndex).height() }); } }, onSlideClick: function(swiper){ } }); swipers['swiper-'+index].reInit(); if(!centerVar){ if($t.attr('data-slides-per-view')=='responsive'){ var paginationSpan = $t.find('.pagination span'); var paginationSlice = paginationSpan.hide().slice(0,(paginationSpan.length+1-slidesPerViewVar)); if(paginationSlice.length<=1 || slidesPerViewVar>=$t.find('.swiper-slide').length) $t.addClass('pagination-hidden'); else $t.removeClass('pagination-hidden'); paginationSlice.show(); } } initIterator++; }); } function updateSlidesPerView(swiperContainer){ if(winW>=addPoint) return parseInt(swiperContainer.attr('data-add-slides')); else if(winW>=lgPoint) return parseInt(swiperContainer.attr('data-lg-slides')); else if(winW>=mdPoint) return parseInt(swiperContainer.attr('data-md-slides')); else if(winW>=smPoint) return parseInt(swiperContainer.attr('data-sm-slides')); else return parseInt(swiperContainer.attr('data-xs-slides')); } //swiper arrows jQuery('.swiper-arrow-left').click(function(){ swipers['swiper-'+jQuery(this).parent().attr('id')].swipePrev(); }); jQuery('.swiper-arrow-right').click(function(){ swipers['swiper-'+jQuery(this).parent().attr('id')].swipeNext(); }); //swiper arrows jQuery('.portfolio-prev').click(function(){ swipers['swiper-'+jQuery(this).closest('.section').find('.swiper-container').attr('id')].swipePrev(); }); jQuery('.portfolio-next').click(function(){ swipers['swiper-'+jQuery(this).closest('.section').find('.swiper-container').attr('id')].swipeNext(); }); /*==============================*/ /* 08 - buttons, clicks, hovers */ /*==============================*/ //Menu mobile jQuery('.open-menu').on('click', function (e) { e.preventDefault(); jQuery('.nav').addClass('active'); }); jQuery('.close-menu').on('click', function (e) { e.preventDefault(); jQuery('.nav').removeClass('active'); }); jQuery('.open-minimal-menu').on('click', function (e) { e.preventDefault(); jQuery('.minimal-nav').addClass('active'); }); jQuery('.menu-item-has-children a').on('click', function () { jQuery(this).next('.sub-menu').slideToggle(); jQuery(this).closest('li').toggleClass('mobile-active'); }); jQuery('.open-sbw-menu').on('click', function () { jQuery(this).parent().next('.sbw').slideToggle(); jQuery(this).parent().toggleClass('mobile-active-title'); }); jQuery('.close-mini-menu').on('click', function (e) { e.preventDefault(); jQuery('.minimal-nav').removeClass('active'); }); //CLOSE MESSAGE BOX jQuery('.close-message').on('click', function (e) { e.preventDefault(); jQuery(this).parent().fadeOut(); }); //ADD MORE INFO jQuery('.add-more').on('click', function (e) { e.preventDefault(); var $this = jQuery(this), parent = $this.closest('.a-info-container'), elements = parent.find('.clone').clone(); parent.find('.row').append(elements); }); //ADD MORE WORK jQuery('.btn-more').on('click', function (e) { e.preventDefault(); var parent = jQuery(this).parent().prev(), clone = parent.find('.mix').clone(); parent.append(clone); }); jQuery('.append-button').on( 'click', function(e) { e.preventDefault(); // create new item elements var $items = jQuery('.item-masonry').clone(); // append items to grid jQuery('.container-masonry').append( $items ).masonry( 'appended', $items ); }); //HIDE INFO jQuery('.hide-info').on('click', function () { if (jQuery('.hide-block').hasClass('act')){ jQuery('.hide-block').removeClass('act'); jQuery(this).removeClass('active'); jQuery(this).find('span').text(jQuery(this).attr('data-hide')); }else{ jQuery('.hide-block').addClass('act'); jQuery(this).addClass('active'); jQuery(this).find('span').text(jQuery(this).attr('data-show')); } return false; // $(this).closest('.a-info-container').find('.hide-block').addClass('act'); }); //SEARCH AREA jQuery('.search-icon').on('click', function (e) { e.preventDefault(); jQuery('.search-panel').addClass('active'); }); jQuery('.close-search').on('click', function (e) { e.preventDefault(); jQuery('.search-panel').removeClass('active'); }); jQuery('.soc-icon').on('click', function (e) { e.preventDefault(); jQuery('.social-area').addClass('active'); }); jQuery('.close-social').on('click', function (e) { e.preventDefault(); jQuery('.social-area').removeClass('active'); }); //SCROLL TOP jQuery('.scroll-top').on('click', function (e) { e.preventDefault(); jQuery('body, html').animate({'scrollTop': 0}, 800); }); //SCROLL TO jQuery('.scroll-to').on('click', function (e) { e.preventDefault(); jQuery('html,body').stop().animate({ scrollTop: jQuery('.start-block').offset().top - 60 }, 800); }); jQuery('.minimal-scroll').on('click', function (e) { e.preventDefault(); jQuery('html,body').stop().animate({ scrollTop: jQuery('.start-block-minimal').offset().top }, 800); }); //Play video jQuery('.play').on('click', function (e) { e.preventDefault(); var src = jQuery(this).data('src'); jQuery(this).hide(); jQuery('.video').attr('src', src).fadeIn(); setTimeout(function() { jQuery('.poster').addClass('hideposter'); },2500); }); jQuery(document).ready(function() { jQuery(".menu-all-pages-container").accessibleDropDown(); }); jQuery.fn.accessibleDropDown = function () { var el = jQuery(this); /* Make dropdown menus keyboard accessible */ jQuery("a", el).focus(function() { jQuery(this).parents("li").addClass("force-show"); }) } // ---------------- Appoiment-form jQuery(document).on('click', '.open-m-popup' , function () { var popupContent = jQuery(this).parent().find('.popup-content'); jQuery('.popup-content').each(function(){ popupContent.clone().appendTo('.medical-popup'); jQuery('.medical-popup').addClass('act'); }); return false; }); jQuery(document).on('click', '.close-medical', function () { jQuery('.medical-popup').removeClass('act'); jQuery('.medical-popup').find('.popup-content').remove(); }); /*==================================== MASONARY ======================================*/ // $('.mason-grid').imagesLoaded(function () { // var $blogisotope = $('.mason-grid').isotope({ // itemSelector: '.mason-item', // percentPosition: true, // masonry: { // columnWidth: '.mason-item' // } // }); // }); /*==============================*/ /* 09 - interface */ /*==============================*/ //Accordion jQuery('.accordion-title').on('click', function () { var $this = jQuery(this); $this.toggleClass('active'); $this.next('.accordion-content').stop().slideToggle(); }); //TABS jQuery('.nav-tab-item').on('click', function(){ var $this = jQuery(this), parent = $this.closest('.tab-wrapper'), index = parent.find('.nav-tab-item').index(this); if(tabFinish || $this.hasClass('active')) return false; tabFinish = 1; $this.closest('.nav-tab').find('.nav-tab-item').removeClass('active'); $this.addClass('active'); parent.find('.tab-info:visible').fadeOut(300, function() { parent.find('.tab-info').eq(index).fadeIn(300, function() { tabFinish = 0; }); }); }); // Esc key close menu document.addEventListener('keydown', function (event) { if (event.keyCode === 27) { event.preventDefault(); jQuery('#masthead #site-navigation').removeClass('active'); } }.bind(this)); /*==============================*/ /* 10 - PLUGINS INIT */ /*==============================*/ //FILTER INIT //AUDIO PLAYER INIT // if($('audio').length) { // $('audio').mediaelementplayer(); // } // info - bar jQuery(".soc-icon").on("click", function() { jQuery(".extra-info").addClass("info-open"); }); jQuery(".close-icon").on("click", function() { jQuery(".extra-info").removeClass("info-open"); }); if(jQuery('#rev_slider_1078_1').length) { var tpj=$; var revapi1078; tpj(document).ready(function() { if(tpj("#rev_slider_1078_1").revolution == undefined){ revslider_showDoubleJqueryError("#rev_slider_1078_1"); }else{ revapi1078 = tpj("#rev_slider_1078_1").show().revolution({ sliderType:"standard", jsFileLocation:"revolution/js/", sliderLayout:"fullscreen", dottedOverlay:"none", delay:9000, navigation: { keyboardNavigation:"off", keyboard_direction: "horizontal", mouseScrollNavigation:"off", mouseScrollReverse:"default", onHoverStop:"off", touch:{ touchenabled:"on", swipe_threshold: 75, swipe_min_touches: 1, swipe_direction: "horizontal", drag_block_vertical: false } , arrows: { style:"zeus", enable:true, hide_onmobile:true, hide_under:600, hide_onleave:true, hide_delay:200, hide_delay_mobile:1200, tmp:'
', left: { h_align:"left", v_align:"center", h_offset:30, v_offset:0 }, right: { h_align:"right", v_align:"center", h_offset:30, v_offset:0 } } , bullets: { enable:true, hide_onmobile:true, style:"metis", hide_onleave:true, hide_delay:200, hide_delay_mobile:1200, direction:"horizontal", h_align:"center", v_align:"bottom", h_offset:0, v_offset:30, space:5, tmp:' {{title}}' } }, viewPort: { enable:true, outof:"pause", visible_area:"80%", presize:false }, responsiveLevels:[1240,1024,778,480], visibilityLevels:[1240,1024,778,480], gridwidth:[1240,1024,778,480], gridheight:[600,600,500,400], lazyType:"none", parallax: { type:"mouse", origo:"slidercenter", speed:2000, levels:[2,3,4,5,6,7,12,16,10,50,47,48,49,50,51,55], type:"mouse", }, shadow:0, spinner:"off", stopLoop:"off", stopAfterLoops:-1, stopAtSlide:-1, shuffle:"off", autoHeight:"off", hideThumbsOnMobile:"off", hideSliderAtLimit:0, hideCaptionAtLimit:0, hideAllCaptionAtLilmit:0, debugMode:false, fallbacks: { simplifyAll:"off", nextSlideOnWindowFocus:"off", disableFocusListener:false, } }); } }); /*ready*/ } //SLIDER if(jQuery( "#slider-range").length) { jQuery( "#slider-range" ).slider({ range: true, min: 0, max: 500, values: [ 75, 300 ], slide: function( event, ui ) { jQuery( "#amount" ).val( "€" + ui.values[ 0 ] + " - €" + ui.values[ 1 ] ); } }); jQuery( "#amount" ).val( "€" + $( "#slider-range" ).slider( "values", 0 ) + " - €" +jQuery( "#slider-range" ).slider( "values", 1 ) ); } jQuery(document).ready(function() { jQuery(".menu").accessibleDropDown(); }); jQuery.fn.accessibleDropDown = function () { var el = jQuery(this); /* Make dropdown menus keyboard accessible */ jQuery("a", el).focus(function() { jQuery(this).parents("li").addClass("force-show"); }).blur(function() { jQuery(this).parents("li").removeClass("force-show"); }); } });