jQuery(function(jQuery) { "use strict"; jQuery(document).click(function(event) { if(jQuery(event.target).attr('name') !== 's' && jQuery(event.target).attr('type') !== 'submit') { jQuery('.navbar-form .form-group').animate({ width: '0px'}, 500) } }); var animEndEventNames = { 'WebkitAnimation': 'webkitAnimationEnd', 'OAnimation': 'oAnimationEnd', 'msAnimation': 'MSAnimationEnd', 'animation': 'animationend' }, animEndEventName = animEndEventNames[ Modernizr.prefixed('animation')], isMobile = navigator.userAgent.match(/(iPhone|iPod|Android|BlackBerry|iPad|IEMobile|Opera Mini)/); var Site = { initialized: false, styles: [{ "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 17 }] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 20 }] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{ "color": "#000000" }, { "lightness": 17 }] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "color": "#000000" }, { "lightness": 29 }, { "weight": 0.2 }] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 18 }] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 16 }] }, { "featureType": "poi", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 21 }] }, { "elementType": "labels.text.stroke", "stylers": [{ "visibility": "on" }, { "color": "#000000" }, { "lightness": 16 }] }, { "elementType": "labels.text.fill", "stylers": [{ "saturation": 36 }, { "color": elizium.color//jQuery.cookie("skin") }, { "lightness": 40 }] }, { "elementType": "labels.icon", "stylers": [{ "visibility": "off" }] }, { "featureType": "transit", "elementType": "geometry", "stylers": [{ "color": "#000000" }, { "lightness": 19 }] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [{ "color": "#000000" }, { "lightness": 20 }] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{ "color": "#000000" }, { "lightness": 17 }, { "weight": 1.2 }] }], initialize: function() { if (this.initialized) return; this.initialized = true; this.build(); this.events(); //this.validation(); this.inputAnimation(); if (jQuery('.btn-bordered.animate').length) { this.btnAnim(); } }, build: function() { /* //team carousel if (jQuery('#partners-carousel').length) { var carousel = jQuery("#partners-carousel"); carousel.owlCarousel({ itemsCustom: [[0, 1], [768, 2], [1000, 3], [1170, 4]], pagination: true, paginationNumbers: false, navigation: false, rewindNav: false, responsiveRefreshRate: 40, afterAction: function() { jQuery('#partners-carousel').find('.owl-controls span').html('◆'); } }); } */ //banner slider if (jQuery('#main-banner').length) { var mainBanner = jQuery('#main-banner'); var headerHeight = jQuery('#header').height(); var fullHeight = function(){ /* mainBanner.height(jQuery(window).height()).css({ marginTop: 0 }); */ if (jQuery('#banner-slider').hasClass('slider-with-bg')) { jQuery('#banner-slider.slider-with-bg').find('.slides>li').each(function() { var dataSrc = jQuery(this).attr('data-src') jQuery(this).find('.table-cell').height(jQuery(window).height()) }) } } var minHeight = function() { /* mainBanner.height(jQuery(window).height() - headerHeight).css({ marginTop: 0 }); */ if (jQuery('#banner-slider').hasClass('slider-with-bg')) { jQuery('#banner-slider.slider-with-bg').find('.slides>li').each(function() { var dataSrc = jQuery(this).attr('data-src') jQuery(this).find('.table-cell').height(jQuery(window).height() - headerHeight) }) } } var topMargin = function() { /* mainBanner.height(jQuery(window).height() - headerHeight).css({ marginTop: headerHeight }); */ if (jQuery('#banner-slider').hasClass('slider-with-bg')) { jQuery('#banner-slider.slider-with-bg').find('.slides>li').each(function() { var dataSrc = jQuery(this).attr('data-src') jQuery(this).find('.table-cell').height(jQuery(window).height() - headerHeight) }) } } var bannerHeight = function() { if (jQuery(window).height() > 372 && elizium.menu_type == "bottom") { minHeight(); } else if (jQuery(window).height() > 372 && elizium.menu_type == "top") { topMargin(); } else { fullHeight(); } } bannerHeight(); jQuery(window).resize(function() { bannerHeight(); }) jQuery(document).on('click', '#header-position .layout-column', function() { if (jQuery(this).attr('id') == "header-bottom") { minHeight(); } else if (jQuery(this).attr('id') == "header-top") { topMargin(); } else { fullHeight(); } }) jQuery('#banner-slider').flexslider({ animation: "fade", controlNav: false, init: function() { jQuery('.main-banner > .rect-icon-box').click(function() { if (jQuery(this).hasClass('next-slide')) { jQuery('.main-banner .flex-next ').trigger('click'); } else if (jQuery(this).hasClass('prev-slide')) { jQuery('.main-banner .flex-prev ').trigger('click'); } }) if (jQuery('#banner-slider').hasClass('slider-with-bg')) { jQuery('#banner-slider.slider-with-bg').find('.slides>li').each(function() { var dataSrc = jQuery(this).attr('data-src') jQuery(this).css({ // backgroundImage: 'url(' + dataSrc + ')' }) }) } } }); } /* circular progressbar if (jQuery(".circle-progress").length) { jQuery(".circle-progress").circliful(); jQuery(document).on('click', '.swatches a', function() { var color = jQuery(this).attr('data-color-hex'); // jQuery.cookie("skin", color); jQuery('.circle-progress').each(function() { jQuery(this).html(' '); jQuery(this).circliful({ foregroundColor: color }); }) }) } */ /*pricing carousel if (jQuery('#pricing-carousel').length) { var pricing = jQuery("#pricing-carousel"); pricing.owlCarousel({ itemsCustom: [[0, 1], [768, 2], [1000, 3]], pagination: false, responsiveRefreshRate: 40, }); // Custom Navigation Events jQuery("#btn-right").click(function() { pricing.trigger('owl.next'); }) jQuery("#btn-left").click(function() { pricing.trigger('owl.prev'); }) } */ }, events: function() { //search form var searchForm = function() { var jQuerynavForm = jQuery('.navbar-form .form-group'); jQuery('.navbar-form .btn').click(function(e) { if (jQuery('.navbar-form .form-group').css('width') === '0' || jQuery('.navbar-form .form-group').css('width') === '0px' || jQuery('.navbar-form .form-group input[type="text"]').val() === "") { e.preventDefault(); if (jQuery(this).hasClass('open')) { jQuery(this).removeClass('open'); jQuerynavForm.animate({ width: '0px' }, 500) } else { jQuery(this).addClass('open'); jQuerynavForm.animate({ width: '222px' }, 500) } } }); } searchForm(); //Animation functions var sideBorder = function() { jQuery('.side-border').each(function() { if (jQuery(window).scrollTop() > (jQuery(this).offset().top - jQuery(window).height() / 1.15)) { jQuery(this).addClass('animate'); } }) } var titleLine = function() { jQuery('.title-line').each(function() { if (jQuery(window).scrollTop() > (jQuery(this).offset().top - jQuery(window).height() / 1.15)) { jQuery(this).addClass('animate'); } }) } /* var doubleBorder = function() { jQuery('.double-border').each(function() { if (jQuery(window).scrollTop() > (jQuery(this).offset().top - jQuery(window).height() / 2)) { jQuery(this).addClass('animate'); } }) } */ var animSection = function() { jQuery('.anim-section').each(function() { if (jQuery(window).scrollTop() > (jQuery(this).offset().top - jQuery(window).height() / 1.15)) { jQuery(this).addClass('animate'); } }) /* jQuery('.pointed-quote').each(function() { if (jQuery(window).scrollTop() > (jQuery(this).offset().top - jQuery(window).height() / 1.15)) { jQuery(this).addClass('animate'); } }) */ } /* var aboutCreating = function() { if (jQuery('.about-creating').length > 0 && jQuery(window).scrollTop() > (jQuery('.about-creating').offset().top - jQuery(window).height() / 1.15)) { jQuery('.about-creating-list').slideDown(2000); } } */ var drawDivider = function() { jQuery('.h-line').each(function() { if (jQuery(window).scrollTop() > (jQuery(this).offset().top - jQuery(window).height() / 1.15)) { jQuery(this).addClass('animate'); if (jQuery(this).hasClass('top')) { jQuery('.team-wrap').addClass('animate'); } else { jQuery('.circle-wrap').addClass('animate'); } } }) } /* var zigZapDivider = function() { jQuery('.zig-zag-divider').each(function() { if (jQuery(window).scrollTop() > jQuery(this).offset().top - jQuery(window).height() && jQuery(window).scrollTop() <= jQuery(this).offset().top) { var left = parseInt(((jQuery(this).offset().top - jQuery(window).scrollTop()) * 100) / jQuery(window).height()); jQuery(this).find('.zig-zag').css({ 'margin-left': (left - 100) + "%" }) } }) } */ /* var triangleParallax = function() { jQuery('.triangle-shape').each(function() { if (jQuery(window).scrollTop() > jQuery(this).offset().top - jQuery(window).height() + 100 && jQuery(window).scrollTop() + 100 <= jQuery(this).offset().top) { var top = parseInt(((jQuery(this).offset().top - jQuery(window).scrollTop()) * 100) / jQuery(window).height()); jQuery(this).css({ 'top': (80 - top) + "%" }) } }) } var triLayout = function() { jQuery('.l-down').each(function() { jQuery('.l-down, .l-down-up').css({ 'border-left-width': parseInt(jQuery('#wrapper').width()) }) }) } if (jQuery('.l-down').length) { jQuery(window).load(function() { triLayout(); }) jQuery(window).resize(function() { triLayout(); }) jQuery(document).on('click', '#layout .layout-column', function() { setInterval(function() { triLayout(); }, 400) }) } */ // goto next section if (jQuery('.scroll-to').length) { jQuery('.scroll-to').click(function(e) { e.preventDefault(); var id = jQuery(this).attr('href'); scrollTo(id); }) } /* start Countdown if (jQuery('#countdown').length) { var austDay = new Date(); //austDay = new Date(2015, 8, 2); austDay = new Date(eliziumTimer.timer); jQuery('#countdown').countdown({ until: austDay }); } end Countdown */ // goto to sections on navigation link jQuery('.navbar-nav >li> a').click(function(e) { if (jQuery('#main-banner').length) { var id; jQuery('.navbar-nav >li> a').parent('li').removeClass('active'); jQuery(this).parent('li').addClass('active'); if (!jQuery(this).attr('data-link')) { id = jQuery(this).attr('href'); scrollTo(id); } } }) var scrollTo = function(id) { var top = jQuery(id).offset().top; jQuery('html, body').animate({ scrollTop: parseInt(top - 30) }, 700) } // navigation link hightlight on scroll var navHighlight = function() { var i = 0, j = 0, ids = [], offsetId = [], hHeight = jQuery('#header .navbar').outerHeight(), scrollTop = jQuery(window).scrollTop(), jQuerynavbarLinks = jQuery('.navbar-nav >li'), navLength = jQuerynavbarLinks.length; jQuerynavbarLinks.each(function() { if (!jQuery(this).find('a').attr('data-link') && jQuery(ids[i]).offset()) { ids[i] = jQuery(this).find('a').attr('href'); offsetId[i] = jQuery(ids[i]).offset().top - hHeight } else { ids[i] = jQuery(this).find('a').attr('data-link'); offsetId[i] = (jQuery(ids[i]).offset()) ? jQuery(ids[i]).offset().top - hHeight : 100; } i++; }) //nav active //jQuerynavbarLinks.removeClass('active'); for (j = 0; j < navLength; j++) { if (j < navLength - 1) { if (scrollTop >= offsetId[j] && scrollTop < offsetId[j + 1]) { jQuery('.navbar-nav >li> a[data-link="' + ids[j] + '"]').parent('li').addClass('active'); jQuery('.navbar-nav >li> a[href="' + ids[j] + '"]').parent('li').addClass('active'); } } else { if (scrollTop >= offsetId[navLength - 1]) { jQuery('.navbar-nav >li> a[data-link="' + ids[navLength - 1] + '"]').parent('li').addClass('active'); jQuery('.navbar-nav >li> a[href="' + ids[navLength - 1] + '"]').parent('li').addClass('active'); } } } } /*big ambition bg parallax var parallax = function(id, val, oVal) { if (jQuery(window).scrollTop() > id.offset().top - jQuery(window).height() && jQuery(window).scrollTop() < id.offset().top) { var px = parseInt(jQuery(window).scrollTop() - (id.offset().top - jQuery(window).height())); px /= val; px = oVal - px; id.css({ 'background-position': 'center ' + px + 'px' }) } }*/ //Events OnScroll if (jQuery('#main-banner').length) { navHighlight(); } jQuery(window).scroll(function() { if (jQuery('#main-banner').length) { navHighlight(); } }) if (!isMobile) { if (jQuery('.anim-section').length) { jQuery('.anim-section').removeClass('animate'); animSection(); } if (jQuery('.title-line').length) { jQuery('.title-line').removeClass('animate'); titleLine(); } /* if (jQuery('.triangle-shape').length) { triangleParallax(); } if (jQuery('.zig-zag-divider').length) { zigZapDivider(); } if (jQuery('.about-creating').length) { jQuery('.about-creating-list').hide(); aboutCreating(); } if (jQuery('.double-border').length) { jQuery('.double-border').removeClass('animate'); doubleBorder(); } */ if (jQuery('.side-border').length) { jQuery('.side-border').removeClass('animate'); sideBorder(); jQuery(window).load(function() { setTimeout(function() { sideBorder(); }, 800) }) } if (jQuery('.h-line').length) { jQuery('.h-line').removeClass('animate'); jQuery('.team-wrap').removeClass('animate'); jQuery('.circle-wrap').removeClass('animate'); drawDivider(); } /* if (jQuery('#big-ambition').length) { jQuery(window).scroll(function() { var jQueryid = jQuery('#big-ambition'); parallax(jQueryid, 2.5, 300); }) } if (jQuery('.about-creating').length) { jQuery(window).scroll(function() { var jQueryid = jQuery('.about-creating'); parallax(jQueryid, 3, 400); }) } */ if (jQuery('.l-down-up').length) { jQuery(window).scroll(function() { if (jQuery(window).width() >= 768) { jQuery('.l-down-up').each(function() { var jQueryid = jQuery(this); var lineWidth = parseInt(jQuery('#wrapper').width()) - 100; if (jQuery(window).scrollTop() > jQueryid.offset().top - jQuery(window).height() && jQuery(window).scrollTop() < jQueryid.offset().top) { var px = parseInt(jQuery(window).scrollTop() - (jQueryid.offset().top - jQuery(window).height())); px = px * 100 / jQuery(window).height(); px = lineWidth + px; // console.log(px) jQueryid.css('border-left-width', px); } else { jQueryid.css('border-left-width', parseInt(jQuery('#wrapper').width())); } }) } }) } jQuery(window).scroll(function() { if (jQuery('.anim-section').length) { animSection(); } /* if (jQuery('.triangle-shape').length) { triangleParallax(); } if (jQuery('.zig-zag-divider').length) { zigZapDivider(); } if (jQuery('.about-creating').length) { aboutCreating(); } */ if (jQuery('.side-border').length) { sideBorder(); } if (jQuery('.title-line').length) { titleLine(); } /* if (jQuery('.double-border').length) { doubleBorder(); } */ if (jQuery('.h-line').length) { drawDivider(); } }) } /* // responsive calendar if (jQuery(".responsive-calendar").length) { jQuery(".responsive-calendar").responsiveCalendar({ time: '2014-08', events: { "2014-08-19": { "url": "#" } } }); } //Form on Focus if (jQuery('.form-control').length) { jQuery('.form-control').focus(function() { jQuery('.form-group').find('label').removeClass('focus'); jQuery(this).parent('.form-group').find('label').addClass('focus'); }) jQuery('.form-control').blur(function() { jQuery('.form-group').find('label').removeClass('focus'); }) } // our partner section animation if (jQuery('.partners-logo a').length) { jQuery('.partners-logo a').hover(function() { jQuery('.partners-logo a').removeClass('right-to-left'); jQuery(this).removeClass('foldit'); jQuery(this).addClass('right-to-left'); }, function() { jQuery('.partners-logo a').removeClass('foldit'); jQuery(this).removeClass('right-to-left'); jQuery(this).addClass('foldit'); }) } */ //accordion sections if (jQuery('#accordion').length) { jQuery(document).on('click', '.panel-title>a', function(e) { jQuery('#accordion').find('.panel-title>a').removeClass('active') jQuery(this).addClass('active').on(animEndEventName, function() { jQuery(this).removeClass('active'); }) }) } //Custom Map if (jQuery('#map').length) { var map = new GMaps({ div: '#map', //lat: 37.748203, //lng: -122.449690, lat: elizium.map_lat, lng: elizium.map_lang, disableDefaultUI: true, zoom: 17, draggable: false, scrollwheel: false }); map.drawOverlay({ lat: map.getCenter().lat(), lng: map.getCenter().lng(), content: '', verticalAlign: 'top', horizontalAlign: 'center' }); map.setOptions({ styles: Site.styles }); jQuery(document).on('click', '.swatches a', function() { var color = jQuery(this).attr('data-color-hex'); Site.styles[8].stylers[1].color = color; //jQuery.cookie("skin", color); map.setOptions({ styles: Site.styles }); }) } /*add more team members if (jQuery('#team-members').length) { var i = 0, team = []; var members = jQuery('#team-members >.col-xs-12.col-sm-6.col-md-3').each(function() { team[i] = jQuery(this).html(); i++; }) jQuery('#add-more').click(function(e) { e.preventDefault(); var i = 0; for (var i = 0; i < team.length; i++) { jQuery('#team-members').append(jQuery('
').addClass('col-xs-12 col-sm-6 col-md-3').append(team[i]).hide().fadeIn(500)) } }) } */ //image in lightbox if (jQuery('.ico-zoom').length) { jQuery('.ico-zoom').fancybox({ padding: 0, closeClick: true, openEffect: 'fade', openSpeed: 300, helpers: { media: {}, buttons: {}, title: { type: 'inside' }, overlay: { css: { 'background': 'rgba(0,0,0,0.85)' } } } }); } /* if (jQuery('#header').length) { jQuery('.navbar-toggle').click(function() { if (jQuery('#header .navbar').hasClass('navbar-fixed-top')) { return false } else { jQuery('html,body').animate({ scrollTop : parseInt(jQuery('#header').offset().top) }, 500) } }) }*/ }, //button animation btnAnim: function() { var speed = 250, easing = mina.easeinout; [].slice.call(document.querySelectorAll('.btn-bordered.animate')).forEach(function(el) { var s = Snap(el.querySelector('svg.right')), path = s.select('path'), pathConfig = { from: path.attr('d'), to: 'M 0 7 L12 7 L24 7 L36 7 L48 7 L60 7 L72 7 L84 7 L96 7' }; var s1 = Snap(el.querySelector('svg.left')), path1 = s1.select('path'), pathConfig1 = { from: path1.attr('d'), to: 'M 48 7 L36 7 L24 7 L12 7 L0 7 L-12 7 L-24 7 L-36 7 L-48 7' }; el.addEventListener('mouseenter', function() { path.animate({ 'path': pathConfig.to }, speed, easing); }); el.addEventListener('mouseleave', function() { path.animate({ 'path': pathConfig.from }, speed, easing); }); el.addEventListener('mouseenter', function() { path1.animate({ 'path': pathConfig1.to }, speed, easing); }); el.addEventListener('mouseleave', function() { path1.animate({ 'path': pathConfig1.from }, speed, easing); }); }); }, /* //form validation validateForm: function() { jQuery('#submit').click(function() { var email = jQuery('#email').val(); if (email == '') { jQuery('#email').parents('.form-group').addClass('error'); return false; } if (IsEmail(email) == false) { jQuery('#email').parents('.form-group').addClass('error'); return false; } }); function IsEmail(email) { var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+jQuery/; if (!regex.test(email)) { return false; } else { jQuery('#email').parents('.form-group').removeClass('error'); } } },*/ inputAnimation: function() { // Input Animation jQuery(".label-text").each(function() { var sop = ''; var scl = ''; jQuery(this).html(sop + jQuery(this).html().split("").join(scl + sop) + scl); jQuery(".ch:contains(' ')").html(" "); }) var d; //animation time jQuery(".form-group input, .form-group textarea").focus(function() { // var tm = jQuery(this).outerHeight() / 2.1 * -1.1 + "px"; var tm = '-30px'; jQuery(this).prev('.label-text').addClass("focussed").children().stop(true).each(function(i) { d = i * 50; //delay jQuery(this).delay(d).animate({ top: tm }, 200, 'easeOutBack'); }) }) jQuery(".form-group input, .form-group textarea").blur(function() { //animate the label down if content of the input is empty if (jQuery(this).val() == "") { jQuery(this).prev('.label-text').removeClass("focussed").children().stop(true).each(function(i) { d = i * 50; jQuery(this).delay(d).animate({ top: 0 }, 500, 'easeInOutBack'); }) } }) } /* , validation: function() { var bool; jQuery('#name,#site,#email,#msg').blur(function() { validateForm2(this); }); jQuery('#submit').click(function() { var i = 0; var x = jQuery('#name').val(); if (x == null || x == "" || x == "Name") { jQuery('#name').closest('.form-group').addClass('error'); bool = false; } else { i++; jQuery('#name').closest('.form-group').removeClass('error'); name_val = jQuery('#name').val(); } var x = jQuery('#site').val(); if (x == null || x == "" || x == "Name") { jQuery('#site').closest('.form-group').addClass('error'); bool = false; } else { i++; jQuery('#site').closest('.form-group').removeClass('error'); comp_val = jQuery('#site').val(); } var x = jQuery('#email').val(); var atpos = x.indexOf("@"); var dotpos = x.lastIndexOf("."); if (atpos < 1 || dotpos < atpos + 2 || dotpos + 2 >= x.length || x == 'Email') { jQuery('#email').closest('.form-group').addClass('error'); bool = false; } else { i++; jQuery('#email').closest('.form-group').removeClass('error'); email_val = jQuery('#email').val(); } var x = jQuery('#msg').val(); if (x == null || x == "" || x == "Message") { jQuery('#msg').closest('.msg-box').addClass('error'); bool = false; } else { i++; jQuery('#msg').closest('.msg-box').removeClass('error'); msg_val = jQuery('#msg').val(); } if (i == 4) { bool = true; } if (!bool) { return false; } else { jQuery.post('mail.php', { name: name_val, email: email_val, company: comp_val, msg: msg_val, }, function(data) { if (data == 1) { setTimeout(function() { jQuery('#name').val(''); jQuery('#email').val(''); jQuery('#site').val(''); jQuery('#msg').val(''); jQuery('#name,#site,#email,#msg').next().removeClass("focussed"); jQuery('.ch').css('top', 0); jQuery('#success').fadeIn(500); jQuery('#success').append(''); setTimeout(function() { jQuery('#success').find('div').remove(); }, 2500) }, 500); } }) // } }); function validateForm2(abc) { if (jQuery(abc).val() != "") { jQuery(abc).parent().removeClass('error'); } else { jQuery(abc).parent().addClass('error'); } //email if (jQuery(abc).attr('id') == 'email') { if ((jQuery(abc).val() != "" || jQuery(abc).val() != null) && (jQuery(abc).val().match(emailRegex))) { jQuery(abc).parent().removeClass('error'); } else { jQuery(abc).parent().addClass('error'); } } } var name_val = ''; var email_val = ''; var msg_val = ''; var comp_val = ''; var emailRegex = /^[a-zA-Z0-9._]+[a-zA-Z0-9]+@[a-zA-Z0-9]+\.[a-zA-Z]{2,4}jQuery/; var numericExpression = /^[(]{0,1}[0-9]{3}[)]{0,1}[-\s\.]{0,1}[0-9]{3}[-\s\.]{0,1}[0-9]{4}jQuery/; } */ }; /* jQuery('.form-submit').append(''); jQuery('#commentform .form-submit').children().wrapAll(''); jQuery('#contact-us-section .form-submit').children('input,i').wrapAll(''); jQuery('#respond p.form-submit').addClass('clearfix'); */ Site.initialize(); jQuery('a.zoom').each(function(){ jQuery(this).attr("data-toggle", "lightbox"); jQuery(this).attr("data-gallery", "pst-gallery"); }); //Gallery if(jQuery('div.gallery').length){ jQuery('div.gallery a').each(function(){ jQuery(this).attr("data-toggle", "lightbox"); jQuery(this).attr("data-gallery", "pst-gallery"); }); } jQuery(document).on('click', '[data-toggle="lightbox"]', function(event) { event.preventDefault(); jQuery(this).ekkoLightbox(); }); function makeid(length) { var result = ''; var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; var charactersLength = characters.length; for ( var i = 0; i < length; i++ ) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } return result; } jQuery("ul.wp-block-gallery").each(function(){ var gallery_id = makeid(10); jQuery(this).find("a").attr("data-gallery", gallery_id); }); jQuery("ul.wp-block-gallery a").bind('click', function(event) { event.preventDefault(); jQuery(this).ekkoLightbox(); }); /* nebeneinanderliegende -articel auf die gleiche Höhe bringen*/ function sameHeightArticle(){ jQuery('article.article-left, article.article-right').css('height', 'auto'); jQuery('article.article-left').each(function(){ var myBro = jQuery(this).parent().next('div').children('article.article-right').eq(0); var newH = Math.ceil( Math.max(jQuery(this).height(), myBro.height()) ); jQuery(this).css('height', newH+'px'); myBro.css('height', newH+'px'); }); } /* Iframe breite anpassen */ function resizeIframe(){ jQuery('#reiseVersicherungIframe').css('width', 'auto'); var newWidth; var ww = jQuery(window).width(); if(ww < 992){ var broW = Math.ceil( jQuery("#header").width() ); newWidth = broW - 60; } else{ var broW = Math.ceil( jQuery("article.article-single").first().width() ); newWidth = broW - 30; } newWidth = newWidth > 660 ? 660 : newWidth; //console.log('resize: ', ww, broW, newWidth ) jQuery('#reiseVersicherungIframe').css('width',newWidth+'px'); } sameHeightArticle(); resizeIframe(); jQuery( window ).resize( function(){sameHeightArticle(); resizeIframe(); } ); jQuery('a.list_more_link').click(function(event){ event.preventDefault(); var targetUL = '#lct-widget-' + jQuery(this).attr('data-tax') + '-more'; jQuery(targetUL).slideDown(2000); jQuery(this).hide(); }) });