I need div tag which is hidden in the first 3 seconds, and will appear automatically, and will remain visible. I know that it can be achieved for example javascript, but how? I have not found anything similar. Thank you in advance!
<script type='text/javascript'> function showDiv() { document.getElementById('mydiv').style.display = 'inline'; } setTimeout("showDiv()", 3000); </script> <div id='mydiv' style='display: none'>content</div> Code (markup):
<script type='text/javascript'> function showDiv() { if(document.getElementById('mydiv').style.display = 'inline') { document.getElementById('mydiv').style.display = 'none'; } else { document.getElementById('mydiv').style.display = 'inline'; } } setInterval("showDiv()", 3000); </script> <div id='mydiv' style='display: none'>content</div> Code (markup): The above code would hide/show the same div every 3 seconds, instead of just once.
Nothing's impossible, you know. But what Jazu was asking for was just to show the div, i guess the user would want to do something with it when it shows, so there is no need to flash (show, hide, show...) it constantly About the performance.. I doubt there would be any difference for such a small piece of code, but in general you are right, MMJ, my bad