Last active
May 19, 2021 15:19
-
-
Save guibranco/5899dc16f71bc2586bf8adc70d4d81db to your computer and use it in GitHub Desktop.
Exibe um elemento após N segundos - Facebook - https://www.facebook.com/groups/frontendbrasil/permalink/3977507682297954/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const seconds = 30; | |
const lsKey = "acesso-anterior"; | |
if (localStorage.getItem(lsKey) === null) | |
setTimeout(showElements, seconds * 1000); | |
else | |
showElements(); | |
function showElements() { | |
localStorage.setItem(lsKey, new Date()); | |
const elems = document.querySelector(".classeAtualASerRemovido"); | |
for (var i = 0; i < elems.length; i++) | |
elems[i].className = "classeParaExibir"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment