do you know (in jquery or vanilla) how to hide an element for a defined time (or during all user session) after the user has clicked a button (in jquery or vanilla)?
SCENARIO:
- user goes to Page1 and click on a link button. This button removes class to ElementX (making it desappears). Until here no problem.
- after user goes to Page2 and he must NOT see ElementX (this must last for 24 hours).
now I have this (but it doesn’t work ):
$(document).ready(function(){
$('#active-promos').addClass('show');
$('.close-promos').click(function(){
$('#active-promos').removeClass('show');
if (!sessionStorage.isActive) {
$('#active-promos').removeClass('bell');
sessionStorage.isActive = 1;
}
});
});
thank you
2
Answers
ok here we are, I got it!
this is my solution:
Ya, you can use setTimeout!