Skip to content

Instantly share code, notes, and snippets.

@stuwilli
Created July 31, 2015 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuwilli/000f3e8cc1fecef67cdc to your computer and use it in GitHub Desktop.
Save stuwilli/000f3e8cc1fecef67cdc to your computer and use it in GitHub Desktop.
MRAID Template
<script src="mraid.js"></script>
<script>
function redirect(){
mraid.open("");
}
function close() {
mraid.close();
}
(function() {
mraid.useCustomClose(true);
var width = 320;
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";
}
})();
</script>
<a id="closeEventRegion" style="height: 32px; width: 32px; display: block; text-decoration: none; position: absolute; z-index: 2; cursor: pointer; top: 15px; right: 5px; background: url(http://discoveryint1.edgeboss.net/download/discoveryint1/ads/close-button.png) 0px 0px no-repeat;"></a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment