JQuery工具模式覆盖-在IE8中被破坏
我的网站上有一个jQuery工具模式覆盖,它在Chrome和Firefox中都能很好地工作。。。然而,当我在IE8中查看页面时,黑色背景遮罩出现在对话框DIV的顶部。。。此外,div显示在页面底部,实际代码与屏幕上的居中代码相反 除此之外,我还得到了一个“第1行字符6的错误”错误,我似乎无法调试这个坏男孩。我在Chrome“Uncaught SyntaxError:Unexpected token”中得到了一个类似的错误,但它不会干扰模式。我感觉它与IE无关,但你永远不知道 任何帮助都将不胜感激 JS文件JQuery工具模式覆盖-在IE8中被破坏,jquery,css,jquery-ui,internet-explorer-8,modal-dialog,Jquery,Css,Jquery Ui,Internet Explorer 8,Modal Dialog,我的网站上有一个jQuery工具模式覆盖,它在Chrome和Firefox中都能很好地工作。。。然而,当我在IE8中查看页面时,黑色背景遮罩出现在对话框DIV的顶部。。。此外,div显示在页面底部,实际代码与屏幕上的居中代码相反 除此之外,我还得到了一个“第1行字符6的错误”错误,我似乎无法调试这个坏男孩。我在Chrome“Uncaught SyntaxError:Unexpected token”中得到了一个类似的错误,但它不会干扰模式。我感觉它与IE无关,但你永远不知道 任何帮助都将不胜感激
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>
确认!添加以下内容更正了该问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
在我开始调试20小时后,我必须停止思考我自己的问题,但在我发帖寻求帮助30秒后
希望这也能帮助其他人。我遇到了完全相同的问题,我通过添加以下行解决了它:
<!doctype html>
对不起,我的英语很差, 我在IE8中也有同样的问题,在IE8中使用compability而不是IE7,这是在IE7、8、9中的工作
#mask-modal{
position:absolute;
z-index:9000;
background-color:#fff;
display:none;}
div id=“#掩码模式”
我不知道你为什么会用同样的答案回答这个一年多前就已经回答过的问题。不过,谢谢。这很常见……问这个问题会迫使你重新体验场景的细节。这样做时,很容易做出诊断。只是想澄清一下,你是说这对你有用吗?很难告诉你从你的第一句话。如果它确实有效,请更新。如果它只适用于IE8,也请更新。ie7、8、9、ie6的工作没有测试,但我与IE8的兼容性不是ie7,那么
对我不起作用,并且用于ie兼容
啊,好的,好多了。谢谢你的澄清!
#mask-modal{
position:absolute;
z-index:9000;
background-color:#fff;
display:none;}
if (jQuery.browser.msie == true && jQuery.browser.version == 8) {
/* Carga el overlay confirmar */
jQuery("#modalconfirmar .modalInput").overlay({
// Calcula el centro de la ventana
top : ((jQuery(parent.document).height() / 2) - (jQuery("#modalconfirmar").innerHeight() + 180 )),
closeOnClick: false,
onBeforeLoad: function(){
// @TODO cargar mask custom
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set height and width to mask to fill up the whole screen
$('#mask-modal').css({
'width':maskWidth,
'height':maskHeight
});
$('#mask-modal').fadeTo(500,0.6);
// Load page into iframe
jQuery(document.body).css('overflow', 'hidden');
},
onLoad : function(){
jQuery("#modalconfirmar").css('z-index', jQuery("#mask-modal").css('z-index') + 10 );
},
onClose : function(){
jQuery("#modalconfirmar .si").off();
$('#mask-modal').fadeOut(400);
}
});}