Skip to content

Instantly share code, notes, and snippets.

@anderly
Last active May 28, 2019 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anderly/542a21c2b713b4d80dd7 to your computer and use it in GitHub Desktop.
Save anderly/542a21c2b713b4d80dd7 to your computer and use it in GitHub Desktop.
DFP Wallpaper Ad Code
<script>
var WallpaperAd = WallpaperAd || {};
/*-------------------------------------------------------------------------------------------------------*/
/* Two values are needed for Wallpaper Ads: */
/* 1.) destinationURL (where you want visitors to go when they click the wallpaper) */
/* - NOTE: Click-throughs to this URL will automatically be tracked in DFP */
/* 2.) backgroundURL (URL of wallpaper background image) */
/* - NOTE: Make sure to change the URL to start with
http://assets.dmagazine.com so that it is served via CloudFlare CDN (this makes pages and images load faster) */
/*-------------------------------------------------------------------------------------------------------*/
/* IMPORTANT: Change only the two variable values below */
/*-------------------------------------------------------------------------------------------------------*/
WallpaperAd.destinationURL = "http://www.arkansas.com";
WallpaperAd.backgroundURL = "http://assets.dmagazine.com/media/1589280/arkansas-bg2.jpg";
/*-------------------------------------------------------------------------------------------------------*/
/* DO NOT MODIFY CODE BELOW */
/*-------------------------------------------------------------------------------------------------------*/
WallpaperAd.clickThroughURL = "%%CLICK_URL_UNESC%%" + WallpaperAd.destinationURL;
(function() {
var d=document,
h=d.getElementsByTagName('head')[0],
s=d.createElement('script');
s.type='text/javascript';
s.async=true;
s.src='//assets.dmagazine.com/content/assets/scripts/footer/dmag.wallpaper-ad.js';
h.appendChild(s);
}());
</script>
@royon7
Copy link

royon7 commented Apr 12, 2019

I'm currently testing this wallpaper out and it works well. The only issue I have is whenever I resize my browser, the left side of the image never moves or expands. So depending on your screen resolution, you'll see a different image on the right side but the left side will always remain static. Is there a way to make changes to the script so I the skinner on the left and right moves/expands together at the same time like the below example?
http://www.cinema.com.my/default_skinnermock_v3.aspx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment