简体   繁体   English

如何设置JavaScript默认警报弹出窗口的Z-index?

[英]How to set z-index of javascript default alert popup?

Javascript code JavaScript代码

 <script>
 function myFunction()
 {
 alert("Welcome!");
 }
 </script>

As the question says, i want to set the z-index of default alert popup. 如问题所述,我想设置默认警报弹出窗口的Z索引。 Is this possible ? 这可能吗 ?

As an alert popup is not a DOM Element, CSS cannot be applied, as if you alert style of a popup, it will return undefined. 由于警报弹出窗口不是DOM元素,因此无法应用CSS,就好像您对警报弹出窗口的style ,它将返回未定义。 Think about it: you can't access javascript variables through CSS, because when it comes to modal dialogs, 想一想:您无法通过CSS访问javascript变量,因为涉及模式对话框时,

您无法控制:P

But don't worry, because remember: 但请放心,因为请记住:

有时您无法控制:)

What you can do, however, is manually create a DOM modal dialog. 但是,您可以手动创建DOM模式对话框。 Here is an example of how to make one. 这是一个制作方法的例子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM