XF 1.2 BuySellAds responsive - will this work?

Mouth

Well-known member
www.BuySellAds.com does not support responsive sites, as they use < div > for their ad injection.
I wondered if this would work to deliver different size ad assets based on browser width?

Code:
<SCRIPT LANGUAGE="javascript">
if (window.innerWidth <= 320) {
  document.write("<div>phone/small size ad</div>");
} else if (window.innerWidth <= 768) {
  document.write("<div>tablet/medium size ad</div>");
} else {
  document.write("<div>desktop/full size ad</div>");
}
</SCRIPT>
 
Back
Top Bottom