Skip to content

Instantly share code, notes, and snippets.

@remy
remy / delay-iframe.js
Created September 28, 2012 10:58
Detect whether an iframe is initialised with a width or not - some browser have a width, some don't
var iframedelay = (function () {
var iframedelay = { active : false },
iframe = document.createElement('iframe'),
doc,
callbackName = '__callback' + (+new Date);
iframe.style.height = iframe.style.width = '1px';
iframe.style.visibility = 'hidden';
document.body.appendChild(iframe);
doc = iframe.contentDocument || iframe.contentWindow.document;