【发布时间】:2017-05-11 23:47:35
【问题描述】:
我有一个使用模式的页面,在单击链接时显示。它适用于文本,但我想不出一种方法让它与冲击波物体一起正常工作。当嵌入代码中时,flash 元素会一直显示,而不是仅在单击模式时显示。我应该怎么做才能让 Flash 一开始是隐藏的,只在点击链接后显示的模态窗口中显示?
这里是 HTML 摘录:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>MODAL</title>
<meta name="description" content="responsive layout demos">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" media="screen" href="css/left-fluid.css">
<!--[if lt IE 9]>
<script src="js/html5shiv.min.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<header></header>
<div class="columns-container">
<div class="left-column">
<div id="modal-window">
<a href="#openModal" class="botao"><h3 class="botao"><i class="fa fa-plus-circle" aria-hidden="true"></i> click here to see the modal with flash</h3></a>
</div>
<div id="openModal" class="modalDialog">
<div>
<a href="#close" title="Close" class="close">X</a>
<P>THIS IS SHOWN IN THE MODAL</P>
<!--THIS IS NOT -> --><embed width="500" height="300" src="flash/stuff.swf">
</div>
</div>
</body>
</html>
这是 CSS:
.modalDialog {
position: fixed;
font-family: Arial, Helvetica, sans-serif;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: rgba(0, 0, 0, 0.8);
z-index: 99999;
opacity:0;
-webkit-transition: opacity 400ms ease-in;
-moz-transition: opacity 400ms ease-in;
transition: opacity 400ms ease-in;
pointer-events: none;
}
.modalDialog:target {
opacity:1;
pointer-events: auto;
}
.modalDialog > div {
width: 600px;
position: relative;
margin: 3% auto;
padding: 5px 20px 13px 20px;
border-radius: 10px;
background: #eee;
}
.close {
background: #606061;
color: #FFFFFF;
line-height: 25px;
position: absolute;
right: -12px;
text-align: center;
top: -10px;
width: 24px;
text-decoration: none;
font-weight: bold;
-webkit-border-radius: 12px;
-moz-border-radius: 12px;
border-radius: 12px;
}
.close:hover {
background: #00d9ff;
}
【问题讨论】:
-
仅供参考 Flash 现在不能在很多设备上运行。您最好将该文件转换为 html5 就绪。
-
我很想这样做,但我做不到。此外,此代码将在专用网络中运行,其中包含仅在 Intranet 上运行的已知浏览器,因此目前这不是问题。
-
你在哪些浏览器中测试过这个?结果都一样?如果在
<!--THIS IS NOT -> -->部分,您使用指向 swf 的 html 容器/嵌入器的 i-frame 会发生什么情况?使用 innerHTML 更新打开的模式窗口有帮助吗?作为最终解决方案,快速测试不同的灯箱工具以确保您当前的代码... -
我使用的是 Firefox、Edge 和 Chrome。通过下面 mlegg 的更正,它在最后两个需要 iframe 的情况下有效,但在 Firefox 中无效。我会尝试你的建议,看看会发生什么并报告。
标签: html css flash modal-dialog