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="