02.02.2005 - Custom Alert
The bulk of the description of this latest experiment and whence it came can be found on it's demonstration page, so I'll not go into detail here, though I will quote its caveat:
This is a demonstration only. I am not saying that this is a production worthy alternative to the default behavior of the window.alert method as it does not allow for true modality. I am only showing what is possible - implement at your own risk. Feel free to contact me with any suggestions.
There...now that the CYA is out of the way, check out how to over-ride the default behavior of the window.alert method.
Tested and works in MSIE6, Firefox 1.0, Opera 7.2+ and Safari. Browsers who fall into the !document.getElementById camp get the normal stuff.
Posted by Justin on February 2, 2005 @ 9:22 pm
Here is a little addition ... replace
with <br/>
Posted by Martin Hintzmann Andersen on February 3, 2005 @ 3:21 am
Posted by Martin Hintzmann Andersen on February 3, 2005 @ 3:24 am
The pre would be easier, of course...I'll have to think on it.
Posted by Steve on February 3, 2005 @ 8:31 am
Regarding IE scroll problem, I guess you can use the onscroll event to move the alert DIV.
Or maybe I'm missing the point here which was only to show that you can override the alert function, which seems rather trivial to me - any function can be overridden in JavaScript, no?
Posted by splintor on February 3, 2005 @ 3:43 pm
Its great how everything that is NOT on the box CANNOT be altered or highlighted or pressed or whatever. That was amazing.
I also agree with splintor, can you make the "window" draggable so incase something behind the "window" can be viewed after moving the window away?
also: does this mean that if I have a javascript that has poping up alert windows I can just put that source code that you showed us and just PASTE it on the header of the existing whatever-javascript and have THIS window pop up instead of old boring windows alert box?
(hope that made any sense)
Posted by kurupt on February 3, 2005 @ 8:59 pm
Posted by Steve on February 3, 2005 @ 11:27 pm
I never seem to stop being amazed by all these dynamic things done with nothing but javascript/dhtml/etc. I mean for me, only way to do it with flash, thats all.
Incredible stuff is on this website. Very useful when needed too. Too bad there aren't that many people today who work their asses off and then share their work so other people can learn from it and maybe use it on their site and stuff like that. you guys rock
Posted by kurupt on February 4, 2005 @ 3:32 am
i'll try this
would be a great and nice solution to my applications.
Posted by horaciod on February 5, 2005 @ 9:23 am
Posted by Mike on March 4, 2005 @ 11:55 am
Posted by Steve on March 4, 2005 @ 2:56 pm
Thanks
Thomas
Posted by Thomas on May 2, 2006 @ 5:30 am
Comments have been closed for this post.