function resizeImages() { $('.popup .image-block').each(function(){ $(this).height($(this).width()); }); } $(document).ready(function(){ /*$('.banners').owlCarousel({loop:true});*/ console.log($('.banners')) $('.banners').owlCarousel({ animateIn: 'fadeIn', animateOut: 'fadeOut', loop: true, autoplayHoverPause: false, smartSpeed: 3000, autoplay: true, autoplayTimeout: 3000, nav: false, mouseDrag: false, touchDrag: false, dots: false, rewindNav: false, items: 1, responsive:{ 0:{ items:1 }, 600:{ items:1 }, 1000:{ items:1 } } }); /*if ( $('.banners').find('.owl-page').size() > 1 ) { $('.banners').find('.owl-page').each(function(){ if ( $(this).index() < 9 ) { $(this).find('span').html( ('0' + ($(this).index() + 1)) ); } else { $(this).find('span').html( ( +$(this).index() + 1) ); } }); }*/ $('.image-block').on('click', '.open-popup', function(event){ if ( $('.wrap-popups').size() > 0 ) { event.preventDefault(); $('body').addClass('body-hidden'); $('.wrap-popups').show(); $('.wrap-popups').scrollTop(0); var el = $(this).closest('.image-block'); var id = el.attr('data-id'); $('.wrap-popups .popup').hide(); $('.wrap-popups .popup#popup_id' + id).show(); resizeImages(); } else { return false; } }); /*$('.intef-object').on('click', 'img', function(){ $('.wrap-popups > .content-objects').find('img').attr('src', $(this).attr('data-fullimg')); $('.wrap-popups').show(); $('.wrap-popups').scrollTop(0); });*/ $('.content-objects').on('click', function(event){ $('.wrap-popups').hide(); $('body').removeClass('body-hidden'); }); $('.wrap-popups').on('click', function(event){ if ( event.target == this ) { $('.wrap-popups').hide(); $('body').removeClass('body-hidden'); } }); /*if ( $('#video').size() > 0 ) { var myVideo = document.getElementById("video"); var playCount = 0; $('#video, .play-video').on('click', function(){ if ( playCount == 0 ) { myVideo.play(); playCount = 1; $('.play-video').hide(); } else { myVideo.pause(); playCount = 0; $('.play-video').show(); } }); }*/ // if ( $(window).width() < 940 ) { // $('.main-menu > li').on('click', function (event) { // if ( $(this).index() == 3 ) { // event.preventDefault(); // $('.sub-menu').toggleClass('h0'); // } // }); // } });