Shayvard Shayvard - 29 days ago 7
Javascript Question

How to not show the popup again when user revisit my site?

I create auto popup in my website, but i have not show the auto popup again when user revisit my site?

My framwork is:

Laravel 5.2


HTML:

<div id="popup_this">
<span class="button b-close">
<span>X</span>
</span>
<h3>A nice ad goes here!</h3>
<p>Nulla at nunc posuere, dictum sem sed, tristique mi.</p>
</div>


jQuery bPopup plugin:

<script src="/path/to/jquery.bpopup.min.js"></script>


Script:

<script>
$( document ).ready(function() {
$('#popup_this').bPopup();
});
</script>

Answer

I would recommend using JS Cookie to set the cookie once the user has seen the pop-up.

Also, you dont need a plugin to perform the pop-up. Just use Jquery and add a class then style everything in css.