When I'm using an javascript alert it's going on top of the browser, not in center position in current version of chrome. How can I control it, and make it center with javascript. In firefox and IE,it's working just fine. My current chrome version 30.0.1599.66
I want to position the alert box in exact center of the browser for all type of browsers and for all versions. Please help........
Any other simple idea on providing alert so that it could be centered, would also be appreciable...
Center the Alert Message Box Using CSS Under that, style it accordingly and position it to the center. Use the “top” and “left” CSS properties to achieve this. Set them as 50%, but as you can see the button below, so the property to 40% for correct alignment.
To customize the position of an alert box, use the CSS “top” and “left” properties. We have a custom alert box, which we've created using jQuery and styled with CSS.
The reason alert() does not work is because previously you have checked "prevent this page from creating additional dialoug" checkbox. lets take a look at this code. There will be two alert boxes if you run the code.
Being dependent upon the browsers for the alerts is not a good choice for any. They change rapidly and are not the same for different browsers.
What i have found useful is to use Alertify JS for all the alert needs. You can customize it for your needs and it looks fabulous anyway.
Since it is a default box, u cannot position it, though u can create your own and position it accordingly.. try this http://jqueryui.com/dialog/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With