Nad*_*tai 6 css firefox google-chrome computed-style ionic-framework
我正在检查https://ionicframework.com/docs/api/alert alert..
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Alert</title>
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
<script nomodule src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core/css/ionic.bundle.css"/>
<style>
:root {
--ion-safe-area-top: 20px;
--ion-safe-area-bottom: 22px;
}
</style>
<script type="module">
import { alertController } from 'https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/index.esm.js';
window.alertController = alertController;
</script>
</head>
<body>
<ion-app>
<ion-header translucent>
<ion-toolbar>
<ion-title>Alert</ion-title>
</ion-toolbar>
</ion-header>,
<ion-content fullscreen class="ion-padding">
<ion-alert-controller></ion-alert-controller>
<ion-button expand="block">Show Alert</ion-button>
</ion-content>
</ion-app>
<script>
const button = document.querySelector('ion-button');
button.addEventListener('click', handleButtonClick);
async function handleButtonClick() {
const alert = await alertController.create({
header: 'Use this lightsaber?',
message: 'Do you agree to use this lightsaber to do good across the galaxy?',
buttons: ['Disagree', 'Agree']
});
await alert.present();
}
</script>
</body>
</html>Run Code Online (Sandbox Code Playgroud)
那里有一个带有 .alert-wrapper 类的元素。
如果您查看应用的 CSS,它会显示 opacity: 0,但计算结果显示 opacity: 1

我尝试从页面中删除所有 CSS 文件,所有 javascript,所有其他元素我尝试将此元素移动到正文(iframe 之外)并应用 opacity: 0 在样式中,没有任何帮助,计算保持不透明度: 1..
这怎么可能?
他们正在使用Web Animations API。
elem.animate([{ opacity: "1" }],{duration: 1, iterations: 1, fill: "forwards"});Run Code Online (Sandbox Code Playgroud)
#elem {
opacity: 0;
}Run Code Online (Sandbox Code Playgroud)
<div id="elem">Hello</div>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
140 次 |
| 最近记录: |