Created
February 2, 2017 17:55
-
-
Save vitalbh/d29ce0c85459a405136afb2a180348de to your computer and use it in GitHub Desktop.
escondendo slot se impressão veio vazia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; | |
googletag.cmd.push(function(){ | |
googletag.pubads().addEventListener('slotRenderEnded', function(event) { | |
if(event.isEmpty) { | |
var div = document.getElementById(event.slot.getSlotElementId()); | |
if(div) { | |
if(div.parentElement.id==="dest-ad-1") { | |
var fallback = document.getElementById("hfallback"); | |
if (fallback) { | |
fallback.style.display = 'block'; | |
div.style.display = 'none'; | |
} else { | |
div.parentElement.style.display = 'none'; | |
} | |
return; | |
} | |
div.parentElement.style.display = 'none'; | |
if(div.parentElement.id==="pub_10"){ | |
document.body.className += ' hide-ad-top'; | |
} | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment