开发者

Styled alert box without a JS library

I would like to 开发者_开发技巧display an alert on my web site. I could use a library like jQuery, but currently, the site does not use one, and I don't think it is a good idea to add a library just for the sole purpose of an alert box.

Is there any way of styling the alert box, or is there a pure js alternative to something like jQuery modal dialog?


Is there any way of styling the alert box

No, it is browser chrome and you can't touch it.

or is there a pure js alternative to something like jQuery modal dialog?

jQuery doesn't have a modal dialog. jQuery UI does.

There is no pure JS alternative — you are dealing in presentation, so you need CSS.

jQuery UI is pure JS + CSS, and anything you can do with it, you can do by writing the JS and CSS yourself. Look at their code if you want an example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜