我遇到了firefox和innerhtml
的问题。我想不通为什么它不工作:/铬,歌剧,IE,Safari浏览器工作正常,但Firefox ...Mozilla Firefox innerhtml无法正常工作
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title>Dokument bez názvu</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/styl.css">
<script type='text/javascript' src='js/jquery-1.9.1.js'></script>
<style>
#displaybox
{
z-index: 10000;
filter: alpha(opacity=100); /*older IE*/
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); /* IE */
-moz-opacity: 1; /*older Mozilla*/
-khtml-opacity: 1; /*older Safari*/
opacity: 1; /*supported by current Mozilla, Safari, and Opera*/
position: fixed;
top: 20px;
left: 0px;
width: 100%;
height: 100%;
color: #FFFFFF;
text-align: center;
vertical-align: middle;
}
body
{
font-family: Calibri;
}
.black_overlay
{
visibility: hidden;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index: 1001;
-moz-opacity: 0.7;
opacity: .70;
filter: alpha(opacity=70);
}
</style>
<script>
function clicker() {
var thediv = document.getElementById('displaybox');
if (thediv.style.display == "none") {
thediv.style.display = "";
thediv.innerHTML = "<embed src='prohlidka.html' height='638' width='1024' ></embed>";
var thelay = document.getElementById('fade');
thelay.style.visibility = "visible";
} else {
thediv.style.display = "none";
thediv.innerHTML = '';
var thelay = document.getElementById('fade');
thelay.style.visibility = "hidden";
}
return false;
}
</script>
</head>
<body>
<div id="fade" class="black_overlay">
</div>
<div id="displaybox" style="display: none; overflow: visible">
</div>
<a id="otevrit" href='#' onclick='return clicker();'>Virtuální mapa</a>
</body>
这是我的代码,CSS的一点点,一个功能和身体。正如我所说,其他浏览器工作正常。他们通常显示innerhtml
正是我需要的。但Firefox并没有,黑色覆盖工作正常。没有错误,当我检查javascript时没有消息。
我跑这个代码以及它工作正常。 – bergie3000
我用iframe替换了嵌入,它工作正常:D非常感谢你。它也解决了我的其他问题^^ – user3197269
@ user3197269:很高兴有帮助:) –