Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 为什么我的弹出模式在重定向到其他页面后不关闭?_Jquery_Html_Popup - Fatal编程技术网

Jquery 为什么我的弹出模式在重定向到其他页面后不关闭?

Jquery 为什么我的弹出模式在重定向到其他页面后不关闭?,jquery,html,popup,Jquery,Html,Popup,我已经创建了一个弹出模式,有选项“立即购物”和“关闭”。这两个选项都起作用,但当Shop Now按钮重定向到我链接的页面时,弹出模式仍显示在后台。我尝试了window.close()并返回false;但两者都不起作用。我对jQuery还相当陌生,我不确定还有什么其他的方法可以做到这一点。我在下面提供了我的HTML和jQuery,以及我的错误的实时版本 HTML 你们能提供JQuery代码,它能做到你们所说的吗?你们在控制台中有错误吗???@JamesDouglas我编辑了我的代码,有一个错误。

我已经创建了一个弹出模式,有选项“立即购物”和“关闭”。这两个选项都起作用,但当Shop Now按钮重定向到我链接的页面时,弹出模式仍显示在后台。我尝试了window.close()并返回false;但两者都不起作用。我对jQuery还相当陌生,我不确定还有什么其他的方法可以做到这一点。我在下面提供了我的HTML和jQuery,以及我的错误的实时版本

HTML


你们能提供JQuery代码,它能做到你们所说的吗?你们在控制台中有错误吗???@JamesDouglas我编辑了我的代码,有一个错误。请在这里检查一下@Rush.2707不,没有出现错误。仍然没有
#hider
元素,并且不要在html5中使用
<div id="popup_box">
  <img src="https://cdn.shopify.com/s/files/1/0569/4201/t/9/assets/b66ede311b21409cb9d306d75b121aa8.png?38140025230256355" alt="" height="250" width="180" align="left">
  <h1>$30 off the purchase of $130 and Free Shipping on order of $29 and up.</h1>
  <h2>Try code: ALZI2017</h2>
  <br>

  <button id="shop"><a href="https://www.alzerina.com/collections/ready-to-wear">Shop Now</a></button>
  <button id="buttonClose">Close</button>

</div> 
 $(document).ready(function () {
    //hide hider and popup_box

    $('#popup_box').fadeIn("slow");

    //on click show the hider div and the message
    $("#showpopup").click(function () {


    });
    //on click hide the message
    $("#buttonClose").click(function () {


        $('#popup_box').fadeOut("slow");
    });

   $("#shop").click(function () {


        $('#popup_box').fadeOut("slow");
    });