0

Hidden/shown

How do I make an element hidden then show after a certain amount of seconds.

12th Jul 2018, 5:04 AM
Ryan Sullivan
Ryan Sullivan - avatar
5 odpowiedzi
+ 1
// onload is because SoloLearn lags window.onload = function(){ // Give the element an ID in HTML var el = document.getElementById("el"); function toggleEl(){ if (el.style.display == "none"){ el.style.display = "block"; // You may replace "block" with "inline" etc. } else{ el.style.display = "none"; } } setInterval(toggleEl, 1000); // That number is milliseconds // If you don't want it to flash, use... // setTimeout(toggleEl, 1000); };
12th Jul 2018, 5:12 AM
James
James - avatar
+ 1
James cheers
12th Jul 2018, 5:26 AM
Ryan Sullivan
Ryan Sullivan - avatar
0
James does not work
12th Jul 2018, 5:18 AM
Ryan Sullivan
Ryan Sullivan - avatar
0
James im trying to hide the hr element then show it.
12th Jul 2018, 5:19 AM
Ryan Sullivan
Ryan Sullivan - avatar
0
I fixed it.
12th Jul 2018, 5:25 AM
James
James - avatar