cc.initialise({ cookies: { necessary: { title: 'Strettamente necessari / tecnici', description: 'Alcuni cookie del sito sono necessari al suo corretto funzionamento e non possono essere disabilitati.' } }, settings: { style: "light", consenttype: "explicit", onlyshowbanneronce: true, refreshOnConsent: true, ignoreDoNotTrack: true, disableallsites: true, hideprivacysettingstab: true }, strings: { customCookie: "This website uses technical cookies to improve your browsing experience and third-party profiling cookies to promote initiatives in line with your requirements. If you want to find out more or do not wish to consent, click here. Clicking outside this banner or on the X allows the use of cookies.", seeDetailsImplicit: '', allowCookies: "X" } }); jQuery(function(){ // cambio il posizionamento della barra in relazione allo scroll di pagina jQuery(window).scroll(function(){ if (jQuery(window).scrollTop() == 0) { jQuery('#cc-notification').css({ 'position': 'relative' }); } else { jQuery('#cc-notification').css({ 'position': 'fixed' }); } }); // intercetto qualsiasi click di link non della barra cookie /* jQuery('a').each(function(){ if ( jQuery(this).closest('#cc-notification').length <= 0 ) { jQuery(this).one('click', function(){ cc.settings.refreshOnConsent = false; jQuery('#cc-approve-button-thissite').trigger('click'); return true; }); } }); */ jQuery('#cc-notification').mousedown(function(event){ //return false; event.stopPropagation(); event.preventDefault(); }); jQuery('#cc-notification a[id!=cc-approve-button-thissite]').click(function(){ location.href = jQuery(this).attr('href'); }); jQuery('body').mousedown(function(){ jQuery('#cc-approve-button-thissite').trigger('click'); }); jQuery('a').each(function(){ if ( jQuery(this).closest('#cc-notification').length <= 0 ) { var href = '' +jQuery(this).attr('href'); if (href && href.indexOf('youtu') < 0) { jQuery(this).mousedown(function(){ /*cc.settings.refreshOnConsent = false;*/ cc.setcookie('cc_'+'necessary', 'yes', 365); location.href = jQuery(this).attr('href'); return false; }); } } }); /*jQuery('window').unload(function(){ cc.setcookie('cc_'+'necessary', 'yes', 365); });*/ if (jQuery('#cc-notification').length > 0) { // nascondo link a pagina informativa cookie jQuery('a[href*=cookie]').closest('li').hide(); } });