在浏览器中缩小swf是Internet Explorer

时间:2012-04-01 02:40:27

标签: internet-explorer size flash

有没有办法将swf的大小(在示例中,大小为750 X 750)更改为500 x 500,但仅当浏览器是IE6,IE7,IE8,IE9?

    <script type="text/javascript" src="swffit.js"></script>
    <script type="text/javascript">
        var flashvars = {};
        var params = {};
        params.allowfullscreen = true;
        var attributes = {};
        attributes.id = "MYSWF";
        attributes.name = "MYSWF";
        swfobject.embedSWF("MYSWF.swf", "MYSWF","100%","100%","9.0.0",false,flashvars,params,attributes);
        swffit.fit("MYSWF", 750, 750);
    </script>

1 个答案:

答案 0 :(得分:1)

我想,你的意思是只有当浏览器是IE时。试试这个;

var flashvars = {};
var params = {};
params.allowfullscreen = true;
var attributes = {};
attributes.id = "MYSWF";
attributes.name = "MYSWF";
swfobject.embedSWF("MYSWF.swf", "cementera","100%","100%","9.0.0",false,flashvars,params,attributes);

if (navigator.appName == 'Microsoft Internet Explorer') {
    swffit.fit("cementera", 500, 500);
} else {
    swffit.fit("cementera", 750, 750);
}