JQuery 工具模态叠加 - 在 IE8 中损坏

标签 jquery css jquery-ui internet-explorer-8 modal-dialog

我的网站上有一个 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/

相关文章:

javascript - 如何使用 javascript 获取对象索引值的 JSON 响应

javascript - 如何使用jquery将表中的数据导出到csv文件

javascript - 向左移动页面内容时显示/隐藏右侧面板

html - Firefox 中的 CSS 渲染问题

javascript - jqueryUI自动完成菜单展示效果

jquery - 如何修改 jquery ui 小部件的外观

javascript - 使用 jQuery 自动播放 slider

javascript - 根据url激活左侧栏的菜单

php - 根据从数据库中动态加载的图像更改 DIV 大小

javascript - 如何在 Jquery ui datepicker 中显示日期格式?