首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SimpleModal IE8问题

SimpleModal IE8问题
EN

Stack Overflow用户
提问于 2013-11-15 13:49:24
回答 1查看 811关注 0票数 0

在in浏览器上有问题..。当然了。我在里面测试过的其他浏览器都很好用..。我希望有人能帮助我,基本上,如果推荐人不是我们,显示简单弹出。

代码语言:javascript
复制
 <!-- Init Age Verification Content -->

<div class="age" id="verify"> 
    <div><img src="/image/white.png"></img></div>
    <div id="noman">ARE YOU OVER 18?</div>
    <div> 
      <p> If not, leave now and we wont tell your mom.
        </br>  By continuing you agree you are 18 or older.
      </p>
    </div>
    <div id="YN">
      <a href="javascript:window.location.href=window.location.href" id="old">Yes</a>
        &nbsp;&nbsp;&nbsp;&nbsp;
      <a href="http://www.sendoff.com" rel="nofollow" id="young">No</a>
    </div>
</div>

<!-- If previous page wasnt from us... Verify -->

  <script>
if ( document.referrer == null || document.referrer.indexOf(window.location.hostname) < 0 ) {
$("#verify").modal({opacity:85, position: ["20%",""], onOpen: function (dialog) {
    dialog.overlay.fadeIn('slow', function () {
        dialog.container.slideDown('slow', function () {
            dialog.data.fadeIn('slow');
            return false;
        });
    });
}});
}
</script>

但是我一直在IE8中得到这个错误:

代码语言:javascript
复制
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
Timestamp: Tue, 16 Jul 2013 12:14:28 UTC


Message: Not implemented

Line: 454
Char: 7
Code: 0
URI: http://www.example.com/catalog/view/javascript/jquery/jquery.simplemodal-1.4.4.js


Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Line: 0
Char: 0
Code: 0
URI: http://www.example.com/

谢谢你们提前帮忙,伙计们!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-15 14:03:21

您应该尝试只在DOM加载之后才运行脚本。

代码语言:javascript
复制
<script>
$(document).ready(function(){
if ( document.referrer == null || document.referrer.indexOf(window.location.hostname) < 0 ) {
$("#verify").modal({opacity:85, position: ["20%",""], onOpen: function (dialog) {
    dialog.overlay.fadeIn('slow', function () {
        dialog.container.slideDown('slow', function () {
            dialog.data.fadeIn('slow');
            return false;
        });
    });
}});
}
});
</script>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20002578

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档