Created
September 18, 2015 14:54
-
-
Save stuwilli/2d33f3e3461244062a99 to your computer and use it in GitHub Desktop.
MRAID Splash Screen Template
This file contains 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
<script src="mraid.js"></script> | |
<style> | |
body { | |
background: black; | |
margin: 0; | |
padding: 0; | |
} | |
#advert { | |
width: 640px; | |
} | |
#close { | |
min-height: 35px; | |
} | |
</style> | |
<script> | |
(function() { | |
mraid.useCustomClose(true); | |
var d = document; | |
var width = 640; | |
var element = document.querySelector('meta[name=viewport]'); | |
if (!element) { | |
element = document.createElement('meta'); | |
element.name = 'viewport'; | |
element.content = 'width=' + width + ', user-scalable=no'; | |
document.getElementsByTagName('head')[0].appendChild(element); | |
} else { | |
element.content = 'width=' + width + ', user-scalable=no'; | |
} | |
mraid.addEventListener('ready', function () { | |
d.getElementById('adClick').addEventListener('click', function (e) { | |
e.preventDefault(); | |
mraid.open('#{click("defaultClick")}'); | |
}); | |
//alert(JSON.stringify(mraid.getExpandProperties())); | |
}); | |
})(); | |
</script> | |
<div id="container"> | |
<div id="close"> | |
<a id="closeEventRegion" style="height: 32px; width: 32px; display: block; text-decoration: none; position: absolute; z-index: 2; cursor: pointer; top: 15px; right: 0; background: url(http://discoveryint1.edgeboss.net/download/discoveryint1/ads/close-button.png) 0px 0px no-repeat;"></a> | |
</div> | |
<div id="advert"> | |
<a id="adClick" href="#"> | |
<img src="http://dniadops-a.akamaihd.net/misc-assets/2015/1441714720_splash_640x960.jpg"><!-- change src url --> | |
</a> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment