我的网站上有一个 jQuery Tools Modal Overlay,它在 Chrome 和 Firefox 中都工作得很好......但是,当我在 IE8 中查看页面时,黑色背景 mask 出现在对话框 DIV 的顶部。 . 此外,div 出现在实际代码所在的页面底部,而不是居中显示在屏幕上。
此外,我还遇到了“第 1 行字符 6 错误”错误之一,而且我似乎无法调试这个坏男孩。我在 Chrome 中遇到了类似的错误“Uncaught SyntaxError: Unexpected token” )"但它不会干扰模态。我觉得它无关,但对于 IE,你永远不知道。
如有任何帮助,我们将不胜感激!!
JS 文件
var api;
showDiv('partmodal');
function showDiv(v){
if (!document.getElementById(v)) return;
if (api)
if (api.isOpened) api.close();
api=$('#'+v).overlay({
mask: {color: '#000000'},
effect:'drop',
api: true
}).load();
}
DIV 对象
<div class="modalpart" id="partmodal">
<h2>
Title <!--It doesn't matter what you put here-->
</h2>
<!--It doesn't matter what you put here-->
</div>
CSS
.modalPart {
background-color:#fff;
display:none;
width:550px;
padding:15px;
text-align:left;
border:2px solid #600;
-moz-border-radius:6px;
-webkit-border-radius:6px;
-moz-box-shadow: 0 0 50px #ccc;
-webkit-box-shadow: 0 0 50px #ccc;
position:fixed;
_position:absolute;
}
.modalpart h2 {
background:url(images/logoac.png) no-repeat;
margin:0px;
padding:10px 0 10px 110px;
border-bottom:1px solid #333;
font-size:20px;
color:#600;
font-family:calibri, hevetica, tahoma, arial;
text-align:right;
}
最佳答案
确认!添加以下内容更正了问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
我必须在开始调试 20 小时后停止解决我自己的问题,但在我发帖寻求帮助后 30 秒。
希望这对其他人也有帮助。
关于JQuery 工具模态叠加 - 在 IE8 中损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3118702/