var h=$( window ).height(); $( window ).resize(function() { h1 = $( window ).height(); if (h != h1) { h = h1; $('.wrapper-flexslider').height(h); } }); var $gallery = $( ".simple-gallery" ).gallery({ w_prop : 4, h_prop : 3, percWidth : [ // >min-width width % [ 1199, 30], [ 991, 29], [ 768, 30], [ 480, 45], [ 0, 100] ] }); $(window).resize(function() { $gallery.update(); }); // lunghezza calcolata al caricamento della pagina e ad ogni resize della schermata var actualWidth; $( document ).ready(function() { /*GOOGLE ANALYSTICS*/ /* $('.ga_mail').click(function() { ga('send', { hitType: 'event', eventCategory: 'button', eventAction: 'click', eventLabel: 'email' }); }); $('.ga_phone').click(function() { ga('send', { hitType: 'event', eventCategory: 'button', eventAction: 'click', eventLabel: 'numero telefono' }); }); $('.ga_mobile').click(function() { ga('send', { hitType: 'event', eventCategory: 'button', eventAction: 'click', eventLabel: 'numero cellulare' }); }); */ $('[data-toggle="tooltip"]').tooltip() $('.wrapper-flexslider').height(h); $('.modal').modal('show'); /*$('#banner').modal('show');*/ $('.carousel').carousel(); //One Animated $('.animated').waypoint(function() { var myAnimated = $(this).data('animated'); var oneSomeAnimated = $(this).data('oneanimeted'); // animazione da eseguire una singola volta if (oneSomeAnimated == true) { // animazione non e' stata gia' eseguita in tal caso la esegue if (!($(this).hasClass(myAnimated))) $(this).toggleClass($(this).data('animated')).css("opacity", "1"); // animazione da eseguire sempre } else $(this).toggleClass($(this).data('animated')); }, { offset: '80%' }); $('.arrow').click() // Effect input $(document).on("blur", 'form input, form textarea', function(){ if($(this).val().length !== 0) { $(this).addClass('filled'); } else { $(this).removeClass('filled'); } }); // Effect input $(document).on("blur", 'form input, form textarea, form select', function(){ if($(this).val().length !== 0) { $(this).addClass('filled'); } else { $(this).removeClass('filled'); } }); // Sposta la pagina al main $("div.arrow").click( function() { topMain = $('main').offset().top; $('html,body').animate({scrollTop: topMain}, 1000); }); }); $(window).load(function(){ $('.flexslider').flexslider({ animation: "fade", slideshowSpeed: 2500, start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation after: function(){}, //Callback: function(slider) - Fires after each slider animation completes end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added removed: function(){} }); $('.flex-caption').hide(); //$('.flex-caption').fadeIn(2000); }); // Inizializza l'effetto input function init_form(form_id) { $.each($('input, textarea, select', '#'+form_id),function(e){ if($(this).val().length !== 0) { $(this).addClass('filled'); } else { $(this).removeClass('filled'); } }) }