var screenWidth = window.innerWidth; if(screenWidth < 767){ var lazyLoadingTrigger=100; }else{ var lazyLoadingTrigger=200; } var floorAdTrigger=0;//Triggers popup floorAd advertisement, after this many pixels have been scrolled. var floorAdRemoveTrigger=0;//Triggers floorAd removal (in microseconds) var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; // "Domain" : "leggioggi.it", //}); googletag.cmd.push(function () { googletag.pubads().setCentering(true); googletag.pubads().disableInitialLoad(); googletag.pubads().collapseEmptyDivs(true); googletag.enableServices(); }); var adUnits = []; adUnits[0] = { identifier: '/42150330/LeggiOggi/LeggiOggi_leaderboard', name: '/42150330/LeggiOggi/LeggiOggi_leaderboard', code: 'div-gpt-ad-1538391516456-0', sizes: [[728, 90], [300, 250], [360, 300], [336, 280], [320, 50], [320, 100]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1]], mobile: [[320, 50]] } }; adUnits[1] = { identifier: '/42150330/LeggiOggi/LeggiOggi_masthead', name: '/42150330/LeggiOggi/LeggiOggi_masthead', code: 'div-gpt-ad-1538391626104-0', sizes: [[300, 250], [360, 300], [336, 280]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1], [728, 90], [468, 60]], mobile: [[300, 250]] } }; adUnits[2] = { identifier: '/42150330/LeggiOggi/LeggiOggi_incontent', name: '/42150330/LeggiOggi/LeggiOggi_incontent', code: 'div-gpt-ad-1538391801951-0', sizes: [[728, 90], 'fluid', [300, 250], [360, 300], [336, 280], [1, 1]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1], [300, 250], [336, 280], [360, 300], [696, 150]], mobile: [[300, 250]] } }; adUnits[3] = { identifier: '/42150330/LeggiOggi/LeggiOggi_below_article', name: '/42150330/LeggiOggi/LeggiOggi_below_article', code: 'div-gpt-ad-1538391867668-0', sizes: [[300, 250], [360, 300], [336, 280]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1], [300, 250], [336, 280], [360, 300], 'fluid'], mobile: [[300, 250]] } }; adUnits[4] = { identifier: '/42150330/LeggiOggi/LeggiOggi_top_sidebar', name: '/42150330/LeggiOggi/LeggiOggi_top_sidebar', code: 'div-gpt-ad-1538392003855-0', sizes: [[728, 90], 'fluid', [300, 250], [360, 300], [336, 280]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1], [120, 600], [160, 600], [300, 250], [300, 600]], mobile: [[360, 300]] } }; adUnits[5] = { identifier: '/42150330/LeggiOggi/LeggiOggi_bottom_sidebar', name: '/42150330/LeggiOggi/LeggiOggi_bottom_sidebar', code: 'div-gpt-ad-1526035351469-0', sizes: [[300, 250], [360, 300], [336, 280], [300, 600]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1], [300, 250]], mobile: [[360, 300]] } }; adUnits[6] = { identifier: '/42150330/LeggiOggi/LeggiOggi_masthead_tools', name: '/42150330/LeggiOggi/LeggiOggi_masthead_tools', code: 'div-gpt-ad-1585661885050-0', sizes: [[300, 250], [360, 300], [336, 280]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1], [970, 250], [970, 90], [728, 90]], mobile: [[320, 100], [320, 50]] } }; adUnits[7] = { identifier: '/42150330/LeggiOggi/LeggiOggi_widget', name: '/42150330/LeggiOggi/LeggiOggi_widget', code: 'div-gpt-ad-1586950082727-0', sizes: [[300, 250]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1], 'fluid'], mobile: ['fluid'] } }; adUnits[10] = { identifier: '/42150330/LeggiOggi/LeggiOggi_skin', name: '/42150330/LeggiOggi/LeggiOggi_skin', code: 'div-gpt-ad-1586950082700-0', sizes: [[300, 250]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1]], mobile: [] } }; adUnits[11] = { identifier: '/42150330/LeggiOggi/LeggiOggi_leaderboard', name: '/42150330/LeggiOggi/LeggiOggi_leaderboard', code: 'div-gpt-ad-1600784534663-0', sizes: [[1, 1]], lazy: true, addSponsorDesc: false, mappings:{ desktop: [[1, 1], [970, 250], [728, 90], [468, 60]], mobile: [[1, 1]] } }; /***** FLOORAD IS ALWAYS SLOT 100 ****/ adUnits[100] = { identifier: '/42150330/LeggiOggi/LeggiOggi_stickyad', name: '/42150330/LeggiOggi/LeggiOggi_stickyad', code: 'div-gpt-ad-1538392198810-0', sizes: [[320, 50], [728, 90]], lazy: false, addSponsorDesc: false, mappings:{ desktop: [[728, 90], [720, 200]], mobile: [[320, 50]] } }; /***** INTERSTITIAL IS ALWAYS SLOT 2w0 ****/ /** classNameLinkIdentifier is the divs on which a click will start the reward ad. */ adUnits[120] = { identifier: '/42150330/LeggiOggi/LeggiOggi_interstitial', name: '/42150330/LeggiOggi/LeggiOggi_interstitial', code: 'div-gpt-ad-1602778526451-0', enabled: true }; var isMobile = false; if (window.innerWidth < 980) { isMobile = true; } var sm = new slotManager.SlotManager(adUnits, { intervalInactivity: 50 , offset: lazyLoadingTrigger}); jQuery(document).ready(function() { var divAdv = jQuery(".gptslot").filter(function() { return (jQuery(this).data('addesktop') == undefined && jQuery(this).data('admobile') == undefined) || jQuery(this).data('addesktop') == "1"; }); if (isMobile) { divAdv = jQuery(".gptslot").filter(function() { return (jQuery(this).data('addesktop') == undefined && jQuery(this).data('admobile') == undefined) || jQuery(this).data('admobile') == "1"; }); } sm.addSlots(divAdv); console.log("[[[ ADSBOOSTER CONFIG BASIC+FLOORAD: diritto.dfp v1.2 ]]]"); }); googletag.cmd.push(function () { googletag.pubads().addEventListener('slotRenderEnded', function (event) { if (event.slot.getSlotElementId() === "floor-ad" && !event.isEmpty) { console.info("[GPT] slotRenderEnded - " + 'floor-ad'); var adWidth = event.size[0]; var adHeight = event.size[1]; var iframe = jQuery("#floor-ad-wrapper").find("iframe").first(); if(iframe.width() != adWidth || iframe.height() != adHeight ){ adWidth = iframe.width(); adHeight = iframe.height(); } setTimeout(function(){ jQuery("#floor-ad-wrapper #close").show(); },500); setTimeout(function () { console.info("[GPT] triggered - " + 'floor-ad'); jQuery("#floor-ad-wrapper").height(adHeight + 0); jQuery("#floor-ad-wrapper>div").width(adWidth); jQuery("#floor-ad-wrapper").animate({ bottom: 0 }); if(floorAdRemoveTrigger > 1){ setTimeout(function () { console.info("[GPT] timeout triggered " + 'floor-ad'); jQuery("#floor-ad-wrapper").animate({ bottom: -adHeight - 10 }, function () { jQuery("#floor-ad-wrapper").remove(); }); }, floorAdRemoveTrigger)} }, 500); }else{ if (event.isEmpty==false) { var SlotElementName = event.slot.getAdUnitPath(); var adUnitId=false; adUnits.forEach(function(element, key) { if(SlotElementName == element.name){ adUnitId=key; } }); var config = adUnits[adUnitId]; if(config.addSponsorDesc){ var conn = document.createElement('div'); conn.style.width = '100%'; conn.style.fontSize = '12px'; conn.style.color = '#fab810'; conn.style.textAlign="center"; conn.style.paddingBottom="5px"; conn.style.paddingTop="15px"; var t=document.createTextNode("Adv"); conn.appendChild(t); var container = document.getElementById(event.slot.getSlotElementId()); var parentA = container.parentNode; parentA.insertBefore(conn, container); } } } }); }); function throttle(fn, wait) { var time = Date.now(); return function() { if ((time + wait - Date.now()) < 0) { fn(); time = Date.now(); } } } /***********************************************************/ /*** ENABLES POPUP on floor of the screen of an ad slot.****/ var css = "\ @media (max-width: 767px){body.corporate {padding-top: 192px !Important;}}\ #floor-ad-wrapper {\ background: #transparent!important;\ position: fixed;\ z-index: 99999;\ width: 100%;\ text-align: center;\ bottom: -294px;\ }\ @media(min-width:980px) {\ #floor-ad-wrapper {\ margin-left: -178px;\ }\ }\ .cont-floor {\ background: transparent;\ margin: 0 auto;\ position: relative;\ }\ #close {\ margin:0!important; line-height:1.3;\ font-size:12px!important;\ right: 0px;\ top: -25px;\ border-radius: 5px;\ padding: 0.1rem 0.5rem;\ position: absolute;\ background: #4db2ec;\ cursor: pointer;\ z-index: 100000;\ color: #fff;\ font-weight: normal;\ }\ #close .close-btn{\ background:url('****METTERE IL LINK DELL'IMAGINE DEL BOTTONE****');\ background-size:cover;\ width:13px;\ height:13px;\ margin-top:2px;\ margin-right:2px;\ display:inline-block;\ }\ #floor-ad {\ z-index: 10000;\ }\ @media(max-width:767px) {\ #close {\ left: 0;\ }\ }", head = document.head || document.getElementsByTagName('head')[0], style = document.createElement('style'); style.type = 'text/css'; if (style.styleSheet) { style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } head.appendChild(style); function showFloorAd(){ var floorad = "\
close
\