//adapt brower
function refreshMainSize()
{
if(swfobject){
var swfobj = swfobject.getObjectById('Launch');
if(!swfobj){
swfobj = document.getElementById('Launch');
}
if(swfobj){
//判断最大的宽度,最小的宽度
if((document.documentElememt || document.body).clientWidth * (1-0.0)>1200){
swfobj.width=1200;
}else{
if((document.documentElememt || document.body).clientWidth * (1-0.0)<960){
swfobj.width=960;
}else{
swfobj.width = (document.documentElememt || document.body).clientWidth * (1-0.0);
}
}
//判断最大的高度,最小的高度
if((document.documentElememt || document.body).clientHeight * (1-0.0)>720){
swfobj.height=720;
}else{
if((document.documentElememt || document.body).clientHeight * (1-0.0)<600){
swfobj.height=600;
}else{
swfobj.height = (document.documentElememt || document.body).clientHeight * (1-0.0);
}
}
}
}
}
refreshMainSize();
window.onresize=function(){refreshMainSize()}JS 让网页中Flash Player的宽度自适应网页大小
最新推荐文章于 2021-06-18 05:13:27 发布
本文介绍了一种通过JavaScript动态调整Flash对象尺寸的方法,确保其在不同屏幕分辨率下能够自适应显示。根据浏览器窗口的大小变化,Flash内容将被调整至合适的宽度和高度。
8618

被折叠的 条评论
为什么被折叠?



