views:

298

answers:

3

I'm trying to use the following js to change the width and height of a swf.

$('object').attr({'width':100,'height':100});
$('object embed').attr({'width':100,'height':100});

The script works well on firefox, safari, IE8. However, it doesn't work on IE7.

Is there any solution?

A: 

How about with

$('object, embed')
    .attr({'width':100,'height':100})
    .width(100).height(100);
Alexander Gyoshev
doesn't work /_\
Alan
are the elements selected? what's the $('object, embed').length?
Alexander Gyoshev
oh...the elements are not selected on IE7
Alan
but even if i try to get the <object> by id or class, it still cannot be selectedis there any solution for this?
Alan
A: 

How about wrap the Flash with a div. Set the Flash to 100% height and width. And then you resize the div instead?

Andy Li
A: 

swffit ? http://swffit.millermedeiros.com/

Cristi Băluță