admin 管理员组文章数量: 1086019
Is there a way to set the height of alert
to display really long messages with enabling scrolling option for messages that extends screen height ?
Help would be appreciated , all plugins are not remended.
Is there a way to set the height of alert
to display really long messages with enabling scrolling option for messages that extends screen height ?
Help would be appreciated , all plugins are not remended.
Share Improve this question asked Dec 27, 2013 at 17:43 ProllyGeekProllyGeek 15.9k9 gold badges56 silver badges77 bronze badges 22- 1 Are you asking about a JavaScript alert box? – user1781710 Commented Dec 27, 2013 at 17:44
-
1
You, as a web developer, have precisely 0 (North, Nada, ...) control over the visual aspect of a javascript
alert
message. That's the precise reason why people wrote javascript plugins to mimick it and allow the desired level of control and UI appearance. Unfortunately you explicitly stated that you don't want to use any plugins, so I am afraid you will have to live with what the alert gives you. – Darin Dimitrov Commented Dec 27, 2013 at 17:45 - 1 Not possible... jQuery dialog would be your best bet! – malkassem Commented Dec 27, 2013 at 17:45
- 1 @ProllyGeek A simple google search: An exact copy or reproduction, as of a document. – h2ooooooo Commented Dec 27, 2013 at 17:46
-
5
@ProllyGeek No, jQuery dialog is not the only solution. You can also choose to reinvent the wheel and make it from scratch or use one of the 10000 JS/CSS libraries that have made a method that can do this, but you cannot do it with the native
alert()
dialog. – h2ooooooo Commented Dec 27, 2013 at 17:47
3 Answers
Reset to default 2You can't control a JavaScript alert
box in anyway.
Modern web development uses a modal dialog box to show this type of information.
jQuery UI dialog()
is one such popular option. See here: http://jqueryui./dialog/
alert()
only takes a message and cannot be configured in any way.
I know of no browsers that implement scrolling in the resulting dialog box. Firefox and IE just pop up a modal Windows MessageBox
in the OS theme's default dialog font, where Chrome has a little piece of toast that pops up towards the top of the browser window.
You would have to use a floating div
to make a sort of fake "dialog box" with the features you want. For example, jQuery dialog, or the excellent alertify.
Not possible.
Jquery will be best for your criteria
Jquery Dialog Link
本文标签: javascriptAlert long messageStack Overflow
版权声明:本文标题:javascript - Alert long message - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744023042a2520144.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论