我想在弹出的

时间:2016-11-24 13:53:47

标签: html css

打开基本页面后,我打电话给Colorbox页面名称enquiry.html 10秒en enquiry.html页面我添加了一个关闭按钮但是它不起作用 看看我的代码

在基页的头部

<link rel="stylesheet" href="http://www.jacklmoore.com/colorbox/example1/colorbox.css" />

在基页正文

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" async></script> 

<script src="http://www.jacklmoore.com/colorbox/jquery.colorbox.js" async></script>
<script>
  function openColorBox(){
    $.colorbox({
      iframe:true,
      width:"90%",
      height:"90%",
      href: "enquiry.html",
      onLoad: function() {
        $('#cboxClose').remove();
        setTimeout(function(){
          $(window).colorbox.close();
        }, 250000)
      }
    });
  }
  function countDown(){
    seconds--
    $("#seconds").text(seconds);
    if (seconds === 0){
      openColorBox();
      clearInterval(i);
    }
  }
  var seconds = 10,
      i = setInterval(countDown, 1000);
</script>
在enquiry.html页面

<input type="button" value="close" onclick=" $(window).colorbox.close()">
  <form name="form1" method="post" action="">
    <p class="close">&nbsp;</p>
  </form>

但点击“关闭”按钮时,它不会关闭

请帮助 在此先感谢

1 个答案:

答案 0 :(得分:0)

您应该尝试使用$.colorbox.close()关闭colorbox弹出窗口

请参阅此页面了解更多详情http://www.jacklmoore.com/colorbox/

相关问题