Hi all,
i am struggling with a javascript setting. In this Corona period i want to inform my site visitors about what changed in our company (For instance when to visit us again) and i want to give that pop-up in a weekly base, with the code i have put under this text the popup checks daily and pop-up daily, how can i set the text to pop-up in a weekly base.
Is someone able to help please?
My text and code are based like this;
<div class="demomelding" style="display: none">
<h5>Beste Klant,</h5>
<p>De maatregelen rondom de bestrijding van het Covid-19 virus treffen ook de dienstverlening van Hexis.<br /><br />Wij zijn open, met de volgende aanpassingen: <br /><br />- Voorkom wachttijden. Bestel vooraf via webshop, mail of telefoon. <br />- Bestellingen kun je tussen 9 en 17 u afhalen. Kom alleen. <br />- We laten max. 3 personen tegelijk binnen. <br />- Hou je aan de route zoals die op de vloer is aangegeven. <br /><br />- Onze bezorgdienst voor de regio rijdt weer, <br /> je bestelling van vandaag wordt weer de volgende dag bezorgd. <br /><br />Dank voor je medewerking.<br />#staysafe </p>
<div onclick="CloseDemoPopup();" class="exit-questions exittext">Klik hier om verder te gaan.</div></div>
<div class="demobg" style="display: none"></div>
<script>
function InitJquery(){if(botCheck()==false)
{
CheckDemoPopup();
}
}
function CheckDemoPopup() {
var localStorageDateTime = new Date(localStorage.getItem("Next-DemoPopup"));
//Check of er al een cookie is gezet
var currentDateTime = new Date(); //get the current time.
var currentDate = currentDateTime.getDate();
var localStorageDate = localStorageDateTime.getDate();
if (localStorageDate == currentDate) {
//Er is al op akkoord geklikt
}
else {
setTimeout(DisplayDemoPopUp, 60);
}
}
function DisplayDemoPopUp() {
$('.demomelding').fadeIn(50);
$('.demobg').fadeIn(100);
$('body').css('overflow', 'hidden');
}
function CloseDemoPopup() {
$('.demomelding').fadeOut(100);
$('.demobg').fadeOut(100);
$('body').css('overflow', 'auto');
localStorage.setItem("Next-DemoPopup", new Date());
//createCookie('Next-DemoPopup', "PopupShowed", 1);
}
</script>
<style>
.demomelding {
width: 600px;
height: 500px;
}
</style>