qwertyuu
qwertyuu

Reputation: 1065

Bookmarklet behind elements

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. alt text

Upvotes: 0

Views: 180

Answers (1)

Ash
Ash

Reputation: 62096

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.

Upvotes: 2

Related Questions