Forum Moderators: open
<div id="banner_0" class="h_banner">
<script>
if ($('#banner_0').css('display') !== 'none') {
// show DFP banner code
}
</script>
</div> var isVisible = $('#banner_0').is(':visible');
if (isVisible) {
// show DFP banner code
}
//css
.disp-none { display: none; }
//html
<div>
Hello
<p id="banner" class="disp-none">world!</p>
</div>
//js
const banner = document.querySelector('#banner');
if (banner.className == "disp-none") alert('It is none!');
.h_banner { display: none }
@media only screen and (max-width: 660px) {
.h_banner { display: block }
} if (document.getElementById('banner_0').offsetParent) {
// show DFP banner code
} // in the header, or a separate .js to be cached
var isMobile;
if (screen.width <= 660)
isMobile = true;
// at each banner
if (isMobile) {
// show DFP banner code
} <div id="banner_0" class="h_banner">
<script>
if (isMobile) {
if (disabled) {
// DFP code
}
else (iVal = $('#banner_0')).ajax(includePath + '/alt.php?width=' + (valWidth = iVal.width()));
}
</script>
</div>