View Single Post
Old 05-02-2011, 08:35 PM   PM User | #1
ARCLite Studio
New Coder

 
Join Date: Sep 2009
Posts: 73
Thanks: 5
Thanked 9 Times in 9 Posts
ARCLite Studio is an unknown quantity at this point
Unhappy Script not catching first trigger event?

Hey everyone,

In the code below its simply being used to hide/show a div "content" whose CSS display value is set to NONE initially, the problem is this script ignores or doesn't fire on the first click, but it works perfect if i click the link a second time. The page has NO other scripts running. any ideas?

Code:
<a href="javascript:void(0)" onmousedown="if(document.getElementById('content').style.display == 'none'){ document.getElementById('content').style.display = 'block'; }else{ document.getElementById('content').style.display = 'none'; }">Contest Rules</a>
ARCLite Studio
ARCLite Studio is offline   Reply With Quote