function report(status, text) { if (status) jQuery("
"+text+"
").appendTo("#infocontainer").delay(200).fadeIn().delay(3500).fadeOut(); else jQuery("
"+text+"
").appendTo("#infocontainer").delay(200).fadeIn().delay(3500).fadeOut(); } jQuery("#fbLike0").hover(function(){ jQuery("#fbLike0").stop(true, false).animate({left:"0"},"medium"); },function(){ jQuery("#fbLike0").stop(true, false).animate({left:"-306"},"medium"); },500); jQuery("#fbLike1").hover(function(){ jQuery("#fbLike1").stop(true, false).animate({right:"0"},"medium"); },function(){ jQuery("#fbLike1").stop(true, false).animate({right:"-306"},"medium"); },500); jQuery(document).on("submit", "form[class!=send]", function(){ var form = jQuery(this); jQuery(form).find(".button").hide(); jQuery(form).find(".loader").show(); jQuery(form).ajaxSubmit({ target:'#answerForm', success: function(){ jQuery(form).find(".button").show(); jQuery(form).find(".loader").hide(); } }); return false; }); jQuery("#showmenu").click(function(){ jQuery("#menu ul.main").toggle().addClass('r'); return false; }); function resize() { if (jQuery(window).width() > 700) { jQuery('.apartment_right .room_mgallery_content').css('height', jQuery('.apartment_right .icons').height()); jQuery('.apartment_right').css('height', jQuery('.apartment_right .icons').height()+80); jQuery('.apartment_right .room_mgallery_content').css('min-height', 430); } else { jQuery('.apartment_right .room_mgallery_content').css('height', 'auto'); jQuery('.apartment_right').css('height', 'auto'); } jQuery('#content').css('min-height', jQuery(window).height()-jQuery('#header').outerHeight()-jQuery('#footer').outerHeight()-jQuery('#footer2').outerHeight()-jQuery('#title').outerHeight() -65+'px'); } jQuery(window).on('resize', function(){ if (jQuery(window).width()>=1000) { jQuery("#menu ul.main").show().removeClass('r'); } else { jQuery("#menu ul.main").addClass('r'); } resize(); }); resize(); jQuery('#menu ul li i').click(function(){ jQuery(this).toggleClass('fa-chevron-down'); jQuery(this).toggleClass('fa-chevron-up'); jQuery(this).parent().parent().find('ul').toggleClass('dmenu'); }); jQuery('.btn_photo').click(function(){ var image = jQuery(this).attr('href'); jQuery('#photoId').val(jQuery(this).attr('data-id')); jQuery(this).parent().parent().parent().parent().parent().parent().find('img.main').attr('src', image); jQuery(this).parent().parent().parent().parent().parent().parent().find('a.mgallery-photo').attr('href', image); jQuery(this).parent().parent().parent().parent().parent().parent().css('background-image', "url("+image+")"); return false; }); jQuery(document).on("swiperight", ".room_mgallery", swiperightHandler ); // Callback function references the event target and adds the 'swiperight' class to it function swiperightHandler( event ){ jQuery( event.target ).find(".owl-prev").click(); } jQuery(document).on("swipeleft", ".room_mgallery", swipeleftHandler ); // Callback function references the event target and adds the 'swiperight' class to it function swipeleftHandler( event ){ jQuery( event.target ).find(".owl-next").click(); } var photos = []; jQuery('.photos_slider .photo a').each(function(){ photos.push(jQuery(this).attr('data-id')); }); var index; jQuery('.btn_prev_photo').click(function(){ var id = jQuery('#photoId').val(); photos.some(function(entry, i) { if (entry == id) { index = i; return true; } }); jQuery('#photo'+photos[index-1]).click(); return false; }); jQuery('.btn_next_photo').click(function(){ var id = jQuery('#photoId').val(); photos.some(function(entry, i) { if (entry == id) { index = i; return true; } }); jQuery('#photo'+photos[index+1]).click(); return false; }); var owl3 = $(".photos_slider"); owl3.owlCarousel({ items: 4, pagination:false, loop:false, nav:true, navText: ["Poprzednie","Następne"], autoPlay:true, autoPlay:3000, margin:0, stopOnHover:true, responsive:{ 0:{ items:1 }, 400:{ items:2 }, 1000:{ items:3 }, 1300:{ items:4 }, } }); jQuery('.image-popup').magnificPopup({ delegate: 'a.mgallery-photo', type: 'image', closeOnContentClick: true, closeBtnInside: false, fixedContentPos: true, mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side image: { verticalFit: true }, gallery: { enabled: true, navigateByImgClick: true, preload: [0,1] // Will preload 0 - before current, and 1 after the current image }, zoom: { enabled: true, duration: 300 // don't foget to change the duration also in CSS } }); jQuery('.btn_prev_photo').click(function(){ var id = jQuery('#photoId').val(); photos.some(function(entry, i) { if (entry == id) { index = i; return true; } }); jQuery('#photo'+photos[index-1]).click(); return false; }); jQuery('.btn_next_photo').click(function(){ var id = jQuery('#photoId').val(); photos.some(function(entry, i) { if (entry == id) { index = i; return true; } }); jQuery('#photo'+photos[index+1]).click(); return false; }); jQuery(document).on({ mouseenter: function () { jQuery(this).find(".arrow").fadeIn(); }, mouseleave: function () { jQuery(this).find(".arrow").fadeOut(); } }, ".room_mgallery"); jQuery(document).on({ mouseenter: function () { jQuery(this).find(".hover").removeClass("resize").addClass("enlarge"); jQuery(this).find(".price").removeClass("resize").addClass("enlarge"); }, mouseleave: function () { jQuery(this).find(".hover").removeClass("enlarge").addClass("resize"); jQuery(this).find(".price").removeClass("enlarge").addClass("resize"); } }, ".apartment"); jQuery('.tabs a').click(function(){ jQuery(this).parent().find('a').removeClass('bg'); jQuery(this).addClass('bg'); jQuery(this).parent().parent().find('.tab').slideUp(); jQuery(this).parent().parent().find('.'+jQuery(this).attr('href')).slideDown(); return false; }); jQuery("#setlang").change(function () { window.location = jQuery(this).parent().parent().attr("action")+jQuery(this).val(); }); jQuery(document).ready( function () { jQuery(document).on("change", ".checkbox", function(){ if(jQuery(this).is(":checked")){ jQuery(this).next("label").addClass("checked"); }else { jQuery(this).next("label").removeClass("checked"); } }); } );