$(document).ready(function(){ var cbHeight = '98%'; var cbWidth = '98%'; if($(window).width() >= 1024){ cbHeight = '80%'; cbWidth = '60%'; } $('.cboxElementPhoto').colorbox({height: cbHeight, transition: 'elastic', close: ''}); $('.cboxElement').colorbox({height: cbHeight, width: cbWidth, transition: 'elastic', close: '',iframe: true}); $('#contact-form, #register-form, #reset-form').on('submit', function(event) { $.colorbox({width: cbWidth, height: cbHeight,transition: 'elastic', close: '', iframe: true, href:$(this).attr('action')+"?" + $(this).serialize()}); event.preventDefault(); }); var isHome = $('body').hasClass('is-home'); if($(window).width() < 1024 && $(window).width() >= 768){ $('#menuRight .banner').clone().appendTo('#menuLeft'); $('#menuRight').empty(); } if($(window).width() < 1024){ if(!isHome){ $('html, body').animate({scrollTop: $('#MainContainer').offset().top - 74}); } } if($(window).width() >= 768){ $('#menuLeft .dropdown.user').addClass('active'); } $('.hamburger').on('click', function(){ $(this).toggleClass('is-active'); if($(this).hasClass('is-active')){ $('.topmenu').fadeIn(); $('html, body').css({overflow: 'hidden'}); }else{ $('.topmenu').fadeOut(); $('html, body').css({overflow: 'auto'}); } }); $('.dropdown .title').on('click', function(){ $(this).parent().toggleClass('active'); if($(this).parent().hasClass('active') && !$(this).parent().hasClass('static')){ $('html, body').animate({ scrollTop: $(this).parent().offset().top },500); } }); $('#news-find').on('submit', function(e){ e.preventDefault(); window.location = "/news/0/find/" + $('#news-find').find('.q').val(); }); $('.items-list .item .more .more-title').on('click', function(){ if($(this).siblings('.more-content').is(':visible')){ $(this).siblings('.more-content').stop().slideUp(); }else{ $(this).siblings('.more-content').stop().slideDown(); } }); }); $('body').ihavecookies({ title: "Cookies & Privacy", message: "Questo sito web utilizza cookie tecnici per assicurarti di ottenere la migliore esperienza sul nostro portale.", expires: 30, moreInfoLabel: 'Maggiori informazioni', acceptBtnLabel: 'Accetta i Cookies', advancedBtnLabel: 'Personalizza Cookies', uncheckBoxes: false, cookieTypesTitle: 'Seleziona i Cookies da accettare', fixedCookieTypeLabel:'Necessari', fixedCookieTypeDesc: 'Si tratta di cookie essenziali per il corretto funzionamento del sito Web.', cookieTypes: [ /* { type: 'Site Preferences', value: 'preferences', description: 'These are cookies that are related to your site preferences, e.g. remembering your username, site colours, etc.' }, */ { type: 'Analytics', value: 'analytics', description: 'Cookie relativi a visite al sito, tipi di browser, ecc.' } ], onAccept: function(){ } });