Html 彩盒关闭问题

Html 彩盒关闭问题,html,colorbox,Html,Colorbox,jQuery Colorbox在表单提交后未关闭,并且未将我重定向到父页面。如果表格输入的数据有误,我想用颜色框。 我在colorbox中直接调用login.html。 我的代码如下 Html第一页 <ul> <li class="call-login-popup"><a href="#">Login</a></li> </ul> <script> $(document).ready(function()

jQuery Colorbox在表单提交后未关闭,并且未将我重定向到父页面。如果表格输入的数据有误,我想用颜色框。 我在colorbox中直接调用login.html。 我的代码如下

Html第一页

<ul>
  <li class="call-login-popup"><a href="#">Login</a></li>
</ul>

<script>
$(document).ready(function() {
              $(".call-login-popup").colorbox({
                  iframe: true,
                  width: 340,
                  height: 555,
                  inline: true,
                  scrolling: true,
                  href:"login.html",
                  });
            });
</script>
$(文档).ready(函数(){ $(“.call login popup”).colorbox({ 伊夫拉姆:是的, 宽度:340, 身高:555, 是的, 滚动:对, href:“login.html”, }); });
第二页login.Html

<form id="login-form" action="demo.html" method="post">
        <input type="text" placeholder="Email" name="email" /><br/>
        <input type="password" placeholder="Password" name="pass" /> <br/>
        <input type="submit" value="Login" />
</form>




单击提交按钮或完成发送表单后,您需要使用colorbox close

parent.jQuery.fn.colorbox.close();
所以你的代码应该是

<input type="submit" value="Login" onclick="Closepopup()"/>
function Closepopup(){
parent.jQuery.fn.colorbox.close();
}

函数Closepopup(){
parent.jQuery.fn.colorbox.close();
}


$(“#关闭弹出窗口”)。单击(函数(){
parent.jQuery.fn.colorbox.close();
})
<input type="submit" value="Login" id="closepopup"/>
$('#closepopup').click(function(){
parent.jQuery.fn.colorbox.close();
})