var $root = $('html, body'); jQuery("#unmute").click(function () { jQuery(this).css("display","none"); jQuery("#mute").css("display",""); player.unMute(); }); jQuery("#mute").click(function () { jQuery(this).css("display","none"); jQuery("#unmute").css("display",""); player.mute(); }); $(window).on('load', function() { if (window.location.hash && $(window.location.hash).length > 0) { if ($(window).width() > 1024) { $root.animate({ scrollTop: $(window.location.hash).offset().top - 60 }, 600); } else { $root.animate({ scrollTop: $(window.location.hash).offset().top - 60 }, 600); } } }); if ($('.selectpicker').length >0) { $('.selectpicker').selectpicker({ dropupAuto: false }); } function infoAggiornate(e) { swal({ type: 'success', text: e, timer: 1500, showConfirmButton: false }) }; $( '.fancy' ).fancybox({ thumbs : { autoStart : true, axis: "y" // Vertical (y) or horizontal (x) scrolling }, // Enable keyboard navigation keyboard: true, slideShow: { autoStart: false, speed: 3000 } }); $('.mappa') .click(function(){ $(this).find('iframe').addClass('clicked')}) .mouseleave(function(){ $(this).find('iframe').removeClass('clicked')}); /*=============================================== Portfolio ===============================================*/ $(".portfolio-wrapper").imagesLoaded(function() { var $portfolioWrapper = $(".portfolio-wrapper").isotope({ itemSelector: ".portfolio-item", transitionDuration: 300 // 0.3 second }); var filter = $(".filter ul li"); // Portfolio Filter // filter.on("click", function() { var filterValue = $(this).attr("data-filter"); $portfolioWrapper.isotope({ filter: filterValue }); filter.removeClass("active"); $(this).addClass("active"); }); }); $( "#inviaRicambiForm" ).click(function() { $( "#ricambiForm" ).submit(); }); //function ricercAttivita() { //$('#ricercaHome').on('form:submit', function () { function ricercAttivita() { //alert("AN"); //event.preventDefault(); //alert("CIAO"); //if ($("#ricercaHome").parsley().isValid()) { var tipo = $('select[name=tipo] option').filter(':selected').val(); var localita = $('select[name=localita] option').filter(':selected').val(); var persone = $("input[name=persone]").val(); var camere = $("input[name=camere]").val(); var bagni = $("input[name=bagni]").val(); var auto = $('select[name=auto] option').filter(':selected').val(); //console.log(bagni); var cerca = ""; if (tipo && tipo!="" && tipo!='seleziona') { cerca = "/tipo-" + tipo; } if (localita && localita!="" && localita!='seleziona') { cerca = cerca + "/localita-" + localita; } if (persone && persone!="") { cerca = cerca + "/persone-" + persone; } if (camere && camere!="") { cerca = cerca + "/camere-" + camere; } if (bagni && bagni!="") { cerca = cerca + "/bagni-" + bagni; } if (auto && auto!="" && auto!='seleziona') { cerca = cerca + "/auto-" + auto; } var ricercaHome = document.getElementById("ricercaHome").action.slice(0,-1); //} window.location = ricercaHome + cerca; } // Load more data $('.load-more').click(function(){ var row = Number($('#row').val()); var cat = $('#cat').val(); var allcount = Number($('#all').val()); var rowperpage = 6; row = row + rowperpage; if(row <= allcount){ $("#row").val(row); //var $grid = $('.portfolio-wrapper').isotope({ // itemSelector: '.portfolio-item', //}); $(".portfolio-wrapper").isotope({ layoutMode : 'masonry' }); $.ajax({ url: 'https://www.casevacanzeduemari.it/assets/ajax/getalbum.php', type: 'post', data: {row:row,cat:cat}, beforeSend:function(){ $(".load-more").text("Caricamento..."); }, success: function(response){ // Setting little delay while displaying new content setTimeout(function() { // appending posts after last post with class="post" //$(".immagine-album:last").after(response).show().fadeIn(); console.log("reload 1"); //$(".portfolio-wrapper").isotope('appended',response); var di="
red
"; newItems = $(response).appendTo('.portfolio-wrapper'); newItems.imagesLoaded(function(){ $(".portfolio-wrapper").isotope('appended', newItems ); }); //$(".portfolio-wrapper").isotope('appended', newItems ); var rowno = row + rowperpage; // checking row value is greater than allcount or not if(rowno > allcount){ // Change the text and background $('.load-more').hide(); //$('.load-more').css("background","darkorchid"); }else{ $(".load-more").text("Visualizza altri"); } $( '.fancy' ).fancybox({ thumbs : { autoStart : true, axis: "y" // Vertical (y) or horizontal (x) scrolling }, // Enable keyboard navigation keyboard: true, slideShow: { autoStart: false, speed: 3000 } }); }, 100); } }); }else{ $('.load-more').text("Caricamento..."); // Setting little delay while removing contents setTimeout(function() { // When row is greater than allcount then remove all class='post' element after 3 element $('.immagine-album:nth-child(3)').nextAll('.post').remove(); // Reset the value of row $("#row").val(0); // Change the text and background $('.load-more').text("Visualizza altri"); }, 2000); } }); //form_daterangepicker_3 $('#form_daterangepicker_3').daterangepicker({ isInvalidDate: function(date) { var dateRanges = prenotazioni; return dateRanges.reduce(function(bool, range) { return bool || (date >= range.start && date <= range.end); }, false); }, timePicker: true, showDropdowns: true, startDate: moment().startOf('hour').add(24, 'hour'), endDate: moment().startOf('hour').add(48, 'hour'), minDate: moment().startOf('hour').add(24, 'hour'), firstDay: 0, locale: { "format": "DD/MM/YYYY", "separator": " - ", "applyLabel": "Conferma", "cancelLabel": "Cancella", "fromLabel": "Da", "toLabel": "Fino al", "customRangeLabel": "Custom", "daysOfWeek": [ "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" ], "monthNames": [ "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" ], } }, function (start, end) { $("#form_daterangepicker_3 .form-control").val(start.format("DD-MM-YYYY hh:mm A") + " - " + end.format("DD-MM-YYYY hh:mm A")); }); if ($("#contattiForm").length > 0) { // needs for recaptacha ready grecaptcha.ready(function () { // do request for recaptcha token // response is promise with passed token $('#contattiForm').parsley().on('form:error', function () { swal({ title: "AVVISO_ERRORE", text: "AVVISO_ERRORE_CAMPI_OBBLIGATORI", type: "error", showConfirmButton: true }); }).on('form:submit', function () { $('#contattiForm').find('input[type=submit]').prop('disabled', true); grecaptcha.execute('6Le2z84ZAAAAAP35f9cBkU3oJDTVEN0PLxjsyS_3', {action: 'homepage'}) .then(function (token) { // add token to form document.getElementById('g-recaptcha-response').value = token; form = $('#contattiForm'); $.ajax({ url: "https://www.casevacanzeduemari.it/assets/ajax/invia-mail.php", type: "POST", data: form.serialize(), success: function (data) { if (data.status == "success") { infoAggiornate(data.message); setTimeout(function () { window.location = 'https://www.casevacanzeduemari.it' }, 2000); } else if (data.status == "error") { $('#contattiForm').find('input[type=submit]').prop('disabled', false); swal({ title: "Errore", text: data.message, type: "error", showConfirmButton: true }); return false; } }, }); }); return false; }); }); } $(window).on("load", function() { e=0; $(".js-eq-box-articoli").each(function() { $(this).height()>e&&(e=$(this).height()) } ), $(".js-eq-box-articoli").height(e) if($(window).width()>768) { e=0; $(".js-eq-altezza").each(function() { $(this).height()>e&&(e=$(this).height()) } ), $(".js-eq-altezza").height(e) } if($(window).width()>768) { e=0; $(".js-eq-altezza-2").each(function() { $(this).height()>e&&(e=$(this).height()) } ), $(".js-eq-altezza-2").height(e) } });