views:

2051

answers:

3

Hi,

I know many have asked this question, but I think my situation is a little bit different.

I have a site where I have some ads which is Flash hidden in a because of xhtml/html compatibility issues. But the flash elements is on top of my jQuery dialogs which is not ideal.

Some solutions have suggested setting wmode to opaque but I can't because my ads are scripts which outputs flash elements.

Another solution suggested hiding ads when a dialog is shown. So my question is: Is there a way to put flash content behind my jQuery dialogs while they are visible and without altering the flash code?

Best regards, Lasse Espeholt

A: 

Have you tried modifying the z-index of the dialog? The setting of bgiframe to true might also do the trick.

(This would be a comment if I had more rep pts)

chelmertz
I have tried z-index. I'm trying bgiframe now :)
lasseespeholt
bgiframe was already setted to true and including jquery.bgiframe.min.js did not help :/
lasseespeholt
A: 

How about manually setting wmode to opaque with javascript after the flash has already loaded?

Mike Crittenden
See my comment above :)
lasseespeholt
+4  A: 

You can't put HTML in front of Flash unless you set wmode to opaque (or transparent).

With the default wmode ("window") the Flash Player takes over all rendering and user interaction in its area. So the browser can't display any HTML in that area. What wmode=" opaque" (or wmode="transparent") does is that it disables this default behavior and kind of integrates the Flash Player area in the browsers usual rendering and layering and such.

But you don't need to alter any Flash content to set wmode, since it is done in the HTML (or via SWFObject or other script that inserts the Flash object element) so if you have control over the "scripts which outputs flash elements" that you mention, you can take care of the wmode setting there.

Lars
I do not have control over the scripts. They are provided and can change every second if it should.I have my scripts in "iframes" <object type="text/html"/> tags. Can I set jQuery to edit wmode in every flash object including flash objects inside "iframes"?
lasseespeholt
OK, that's to bad. I don't know if you could make jQuery alter the flash object html code on the fly, but altering it once the flash has loaded may require a reload of the flash, I think, resulting in each ad being loaded twice. Hiding the ads when a dialog is displayed seems like the best solution so far, I think.
Lars
That is what I have done now, thanks :)
lasseespeholt