Template:Stylesheet
From 2012hs.igem.org
(Difference between revisions)
Line 5: | Line 5: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
+ | var timeout = 500; | ||
+ | var closetimer = 0; | ||
+ | var ddmenuitem = 0; | ||
- | + | function mopen(id) | |
+ | { | ||
+ | mcancelclosetime(); | ||
+ | |||
+ | if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; | ||
+ | |||
+ | ddmenuitem = document.getElementById(id); | ||
+ | ddmenuitem.style.visibility = 'visible'; | ||
+ | |||
+ | } | ||
+ | |||
+ | function mclose() | ||
+ | { | ||
+ | if(ddmenuitem) ddmenuitem.style.visibility = 'hidden'; | ||
+ | } | ||
+ | |||
+ | function mclosetime() | ||
+ | { | ||
+ | closetimer = window.setTimeout(mclose, timeout); | ||
+ | } | ||
+ | |||
+ | function mcancelclosetime() | ||
+ | { | ||
+ | if(closetimer) | ||
+ | { | ||
+ | window.clearTimeout(closetimer); | ||
+ | closetimer = null; | ||
+ | } | ||
+ | } | ||
+ | document.onclick = mclose; | ||
</script> | </script> | ||
Revision as of 23:46, 9 June 2012