I have a bookmarklet that will come up with a iframe that will load a web form I have. On most site, it works fine with the bookmarklet on top of every element in the current html page. But for certain sites with a lot of javascript loading (e.g. meebo.com), the loaded iframe will go below. How can i troubleshot this? Thanks. attached screen shot.
Asked
Active
Viewed 167 times
0
1 Answers
2
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
- 60,973
- 31
- 151
- 169
-
But how do you get the current highest z-index? Firebug? – qwertyuu Sep 01 '09 at 06:19
-
@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 Sep 01 '09 at 06:45