【问题标题】:jquery.simplemodal > script error on ie8jquery.simplemodal > ie8 上的脚本错误
【发布时间】:2011-12-26 19:53:02
【问题描述】:

在 Internet Explorer 8 上使用 jquery.simplemodal 时遇到 javascript 错误;在 chrome、firefox、safari 上运行良好。

错误是 's.d.wrap' 为空或不是第 475 行的对象。

知道如何让它在 Internet Explorer 8 上运行吗?

相关代码。在头脑中:

<script src="ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"; type="text/javascript"></script>

<script src="/system/js/jquery.ui.core.js" type="text/javascript"></script>

<script src="/system/js/jquery.ui.widget.js" type="text/javascript"></script>

<script src="{url:/system/js/jquery.ui.mouse.js}" type="text/javascript"></script>

<script src="/system/js/jquery.ui.sortable.js" type="text/javascript"></script>

<script src="/system/js/jquery.simplemodal-1.4.1.js" type="text/javascript"></script>

对于模态窗口:

$("#detail-pane").animate(  { height: gPaneHeight + 'px'     }, 500,
   function() {
      $.modal( "<div id='warning-box' class='warning-box'></div>", 
               { closeHTML:"", 
                 containerCss:{ backgroundColor:"#b8b9b9",
                                height:gPaneHeight, 
                                padding:0, 
                                width:993 },
                 position: [ 108, ($(window).width() / 2) - (993 / 2) ], 
                 overlayClose:true, 
                 onClose:function(dialog) { closePane(); }, 
                 onShow: function(dialog) { // filling in box content 
                                          } 
              }); 
   } 
);

提前致谢, 莱昂内尔

【问题讨论】:

  • 可能需要检查您在代码中声明内容的方式(如果您希望人们提供帮助,请在此处添加)。另外,请确保您已清除缓存并且 IE 使用的 JS 是最新版本
  • 在头部:codecode
  • 打开modal的例子:code$("#detail-pane").animate( { height: gPaneHeight + 'px' }, 500, function() { $.modal( "
    ", { closeHTML:"", containerCss:{ backgroundColor:"#b8b9b9", height:gPaneHeight, padding:0, width: 993},位置:[108,($(窗口).width()/2)-(993/2)],overlayClose:true,onClose:function(dialog){closePane();},onShow:function(dialog ) { // 填写框内容 } }); } ); code

标签: jquery simplemodal


【解决方案1】:

不应该

<script src="{url:/system/js/jquery.ui.mouse.js}" type="text/javascript"></script>

成为

<script src="/system/js/jquery.ui.mouse.js" type="text/javascript"></script>

?

【讨论】:

  • {url:xxxx} 是来自 CMS 的用于管理生成的 URL 的指令。经 CMS 处理后,带有准确的 URL。
【解决方案2】:

我在 Simple Modal 版本 1.4.1 上遇到了同样的问题 我已升级到最新的 Simple Modal 1.4.3,问题已在 IE7 和 IE8 中修复

查看http://www.ericmmartin.com/simplemodal-1-4-3-released/

【讨论】:

    【解决方案3】:

    替换为 (d.d.wrap) ? d.d.wrap.focus() : f.focus()

    【讨论】:

      猜你喜欢
      • 2013-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-01
      • 1970-01-01
      • 2014-02-07
      相关资源
      最近更新 更多