tags:

views:

74

answers:

2

For a standard Javascript alert() box, is it possible to have it appear in a position other than the center of the screen? Can you specify horizontal and/or vertical position?

+4  A: 

Afaik, it cannot be positioned where you want it.

Instead of using the default js alert box, you can always use one of the JS framework / toolkit solutions that offer way more in terms of functionality and customization.

I'm personally a fan of jQuery and jQueryUI

code_burgar
+2  A: 

Indeed, I would personally discourage you from using Javascript alert() boxes altogether - they look 1995-ish and don't provide for a nice, customizable user experience. Instead, like the other poster suggested, use a standard Javascript library that will allow you to pop up a "modal" floating DIV, as well as paint a semi-transparent color all over the background, which will make for a beautiful, understandable, easy-to-use user interface.

Alex