简体   繁体   中英

How do I disable an swf object using javascript? e.g swfObject.disabled = true;

I want to basically do something like this

<div id="mySwfParent">
   <swfObject></swfObject>
</div>

Then later on some event I do this

document.getElementById('mySwfParent').disabled = true;

But this has no effect on the swfObject, it still responds to mouse events.

How do I disable an swf object using javascript or prevent it from responding to mouse events?

I would recommend placing a transparent div over the entire area of the swf, effectively blocking the swf from mouse interaction. Be aware that you'll need to play around with the wmode parameter of the swf. Try setting it to both opaque and transparent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM