-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathIframeResize.js
29 lines (28 loc) · 986 Bytes
/
IframeResize.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
document.write('<img src="https://secure-assets.rubiconproject.com/static/psa/casala/CASALA_leaderboard_ad.gif">');
function get_container_iframe()
{
var rtn_iframe=null;
var iframes=window.parent.document.getElementsByTagName('iframe');
for (var i=0; i<iframes.length; ++i)
{try
{var d=iframes[i].contentDocument || iframes[i].contentWindow.document || iframes[i].document; //ie | firefox etc | ie5
if (d===window.document)
{rtn_iframe=iframes[i];
break;
}
}
catch(e) {}
}
return rtn_iframe;
}
get_container_iframe().onload = function(){
try {
if (resize){
get_container_iframe().width= "970px !important";
get_container_iframe().height= "66px !important";
}
}
catch(err){
console.log("resizeIsNotDefined");
}
};