View RSS Feed

molendijk

Custom alerts

Rate this Entry
It is surprisingly easy to create iframes that go on top of windowed elements (Flash, select boxes etc.):
Code:
<iframe name="ifr" style="position:relative; z-index:10000; background: white" onload="frames['ifr'].document.body.innerHTML='This is an iframe that overlays windowed elements if the zindex is high enough'"></iframe>
The onload-part will cause the text to overlay any windowed element if the zindex is high enough (except in Safari). Position: absolute is also possible. Background-color must be specified.

So when someone asked me - recently - to create a script producing styleable alert boxes, I immediately thought of using iframes like the one above for this purpose. You can view the result HERE.

EDIT:
I was not happy with the fact that the old script didn't allow us to write html (into the alerts) in the normal way. So I revised it. I also added the possibility to dynamically size the window.
You can find the new script plus demos and explanations HERE.

Submit "Custom alerts" to del.icio.us Submit "Custom alerts" to StumbleUpon Submit "Custom alerts" to Google Submit "Custom alerts" to Digg

Updated 08-09-2014 at 03:52 PM by molendijk

Tags: None Add / Edit Tags
Categories
Uncategorized

Comments

  1. molendijk's Avatar
    I was not happy with the fact that the old script didn't allow us to write html (into the alerts) in the normal way. So I revised it. I also added the possibility to dynamically size the window.
    You can find the new script plus demos and explanations here.