I have set my code like this, that when the page is refreshed it will show a popup and make the counter one. And once the counter is one popup should not be displayed again.
I am having this issue that it is showing and again on the same page and I want it to show the popup on the same page. When then is changed to another, then same process is to be repeated.
var counter = 0;
counter ++;
if(counter == 1)
{
setInterval(function () {
$('.popup2, .overlay2').fadeIn();
}, 1500);
}
else {
$('.popup2, .overlay2').fadeout();
}
I have also tried this code but it is not working
if ($ .cookie("popup_1_2") == null) {
setInterval(function () {
$('.popup2, .overlay2').fadeIn();
}, 1500);
$ .cookie("popup_1_2", "2");
}