Is it possible to create a non-centered Javascript alert box?

前端 未结 2 497
没有蜡笔的小新
没有蜡笔的小新 2021-01-20 12:28

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 ver

相关标签:
2条回答
  • 2021-01-20 12:59

    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.

    0 讨论(0)
  • 2021-01-20 13:05

    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

    0 讨论(0)
提交回复
热议问题