Display A Popup Only Once Per User

HTML:

<div id="wrap-banner">
        <div id="banner">
        <div class="text">    <br>   
        <br>
        <a href="" target="_blank"><span style="height: 80px;background: #161616;padding: 20px 50px;color:#fff;background-color:#4865a1;"><strong>JOIN US</strong></span></a>
        </div>
        <span id="close-offer"><img src="/images/cnew/close-banner.png" /></span>
        </div>
    </div>

jQuery code:

jQuery(document).ready(function(){
        
        if(localStorage.getItem('popState') != 'shown'){
            jQuery('#wrap-banner').css({
                'display':'block'
            });
            localStorage.setItem('popState','shown')
        }   
        
        jQuery('#close-offer').click(function(){
            jQuery('#wrap-banner').hide();
        });
    });

Leave a Reply

Your email address will not be published. Required fields are marked *