swf的Javascript窗口大小
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了swf的Javascript窗口大小相关的知识,希望对你有一定的参考价值。
function setFlashSize(flashWidth,flashHeight){ var size = [0,0]; if( typeof( window.innerWidth ) == 'number' ) { size = [window.innerWidth, window.innerHeight]; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { size = [document.documentElement.clientWidth, document.documentElement.clientHeight]; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { size = [document.body.clientWidth, document.body.clientHeight]; } window.onresize = function() { document.getElementById("flashContainer").style.minWidth = flashWidth+"px"; document.getElementById("flashContainer").style.minHeight = flashHeight+"px"; document.getElementById("flashContainer").style.width = size[0] < flashWidth ? flashWidth+"px" : "100%"; document.getElementById("flashContainer").style.height = size[1] < flashHeight ? flashHeight+"px" : "100%"; }; window.onload = function(){ window.onresize(); } } SWFObject.embedSWF("example.swf", "flashMovie", "100%", "100%", "6.0.0","expressInstall.swf"); setFlashSize(600,400);
以上是关于swf的Javascript窗口大小的主要内容,如果未能解决你的问题,请参考以下文章