Crystal Lee Crystal Lee - 1 month ago 6
CSS Question

How to get the close X button to work on popup

Everything of this code is working but the close button. I have been racking my brain over it for 2 hours and nothing. Can someone look into the code for me please.

$( document ).ready(function() {
$('#popup_this').bPopup(); });

<div id="popup_this" style="z-index: 9998">
<span class="button b-close">
<span>X</span>
</span>

.b-close {
position: absolute;
right: 0;
top: 0;
cursor: pointer;
color: #fff;
background: #000;
padding: 5px 10px; z-index: 9000;}

Answer

Try using Jquery

$( document ).ready(function() {
    $( ".b-close" ).click(function() {
      $( "#popup_this" ).hide( "slow");
    });
});