views:

36

answers:

1
+2  A: 

If you are using a positionable element such as a div, you should ensure the z-index style is set to a value higher then any other element.

Of course the page you load in the iFrame may also be doing exactly this. Therefore you may need to use a timer (setTimeout) to delay for say 500ms and then get the current highest z-index and add 1 to it.

Also, because you don't know in advance anything about the page shown in the iFrame, you would actually need to manually search for all elements containing a z-Index style. Once you have a collection of these elements, then get the highest z-Index value.

I'd definitely look at using jQuery to make this much easier.

Ash
But how do you get the current highest z-index? Firebug?
qwertyuu
@qwertyuu I've updated my answer. Use jQuery on the iFrame content to get all elements with a z_index, then just find the highest value and add 1 to it.
Ash