View Single Post
Old 06-28-2012, 08:28 PM   PM User | #3
djnp
New to the CF scene

 
Join Date: Jun 2012
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
djnp is an unknown quantity at this point
Quote:
Originally Posted by WolfShade View Post
I don't completely follow. It has to be shown in order to be clicked, so it's already shown. You can automatically hide anything by using setTimeout("function",x); where x is the number of milliseconds (1000 per second) to call the function.
Thanks for your response. I am new to JS as you can see the code below:

Code:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
function showArrow(o) {
	document.getElementById(o).style.display='block';
	setTimeout("showArrow()", 2000);
	}
</script>

<a href="javascript: showArrow('arrow');">show that arrow</a>
<div id="arrow" style="display:none; position: absolute; top: 50px; left: 50px;">↗</div>
I have tried above code and it works for showing the hidden DIV however it doesn't automatically hide the DIV. As I don't know where to specify following code for hiding the DIV?

Code:
document.getElementById(o).style.display='none';

Thanks!!

Last edited by djnp; 06-28-2012 at 08:33 PM.. Reason: to make it more clear
djnp is offline   Reply With Quote