w=$(window).width(); h=$(window).height(); // lunghezza calcolata al cariamento della pagina e ad ogni resize della schermata var actualWidth; /** * Vertically center Bootstrap 3 modals so they aren't always stuck at the top */ $(function() { function reposition() { var modal = $(this), dialog = modal.find('.modal-dialog'); modal.css('display', 'block'); // Dividing by two centers the modal exactly, but dividing by three // or four works better for larger screens. dialog.css("margin-top", Math.max(0, ($(window).height() - dialog.height()) / 2)); } // Reposition when a modal is shown $('.modal').on('show.bs.modal', reposition); // Reposition when the window is resized $(window).on('resize', function() { $('.modal:visible').each(reposition); }); }); $( document ).ready(function() { /*Define Firefox o Ie*/ var is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') >-1; var is_ie = navigator.userAgent.toLowerCase().indexOf('rv') >-1; var is_iOS = ( /iPhone|iPad|iPod/i.test(navigator.userAgent) ); actualWidth = $(window).width(); $('#zoom').modal('hide'); $('#informativa').modal('hide'); $('#service').modal('hide'); $( ".table" ).wrap( "
" ); /*DROPDOWN*/ /* Add slideDown animation to dropdown*/ $('.dropdown').on('show.bs.dropdown', function(e){ $(this).find('.dropdown-menu').first().stop(true, true).slideDown(); }); /*Add slideUp animation to dropdown*/ $('.dropdown').on('hide.bs.dropdown', function(e){ $(this).find('.dropdown-menu').first().stop(true, true).slideUp(); }); // le animazioni waypoint laterali estendono la pagina causando problemi di visualizzazione nei sistemi operativi IOS // le animazioni waypoint disabilitate if(is_iOS) { $('.animated').css("opacity", "1"); } else { //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%' }); } $('.box-video').click(function() { window.location.href = 'video.php'; }); }); function getCookie(cname) { var name = cname + "="; var decodedCookie = decodeURIComponent(document.cookie.replace(/\+/g, ' ')); var ca = decodedCookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } $(window).load(function() { var policyCookie = getCookie('policyCookie'); if (policyCookie == "0") { $('#cookie_third').hide(); } if (policyCookie == "") { $('.cookie-btn-erase').hide(); } })