gpt4 book ai didi

javascript - 警报框消息显示在一行中

转载 作者:行者123 更新时间:2023-12-03 06:40:57 24 4
gpt4 key购买 nike

在 JavaScript 中,我希望警报消息出现在一行中(更改警报框的大小而不是将消息分成多行)。有办法做到这一点吗?

这是我现在收到的警报消息。邮件内容没问题。但是在“Stream Definition:”将显示在一行中之后,我想知道是否有任何可能的方法来显示消息的其余部分,即实际的流定义全部在一行中?

Current alert message

最佳答案

您无法通过纯 css 更改警报框的样式,因为它是前面提到的系统对象。

我有一些链接,您可以查看自定义警报框:

Stylish JavaScript Dialog (Alert, Confirm, Prompt) Boxes
Sweet alert <-- I prefer and use this one myself. It is really simple and looks really nice in my opinion.
boot box <-- has been mentioned before, it is quite nice but a little more advanced and more code
a tutorial by Adam Khoury <-- I don't know if you know this guy, but he is amazing in explaining coding stuff. He has a tutorial about Custom Alert Box Programming Tutorial

希望这对您有一点帮助。祝你好运,如果你有什么需要帮助的。请评论,我会尽力帮助您。

编辑:

您需要download the project
然后加载文件:
<script src="dist/sweetalert.min.js"></script>
<link rel="stylesheet" type="text/css" href="dist/sweetalert.css">

然后调用弹出窗口

swal({ title: "Are you sure?", text: "You will not be able to recover this imaginary file!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Yes, delete it!", closeOnConfirm: false }, function(){ swal("Deleted!", "Your imaginary file has been deleted.", "success"); });

关于javascript - 警报框消息显示在一行中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37962344/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com