Difference between revisions of "Template:Hebrewu/Javascript"

 
Line 1: Line 1:
<script>
 
 
     var timeout    = 500;
 
     var timeout    = 500;
 
     var closetimer = 0;
 
     var closetimer = 0;
Line 30: Line 29:
 
          
 
          
 
     document.onclick = ddmenu_close;
 
     document.onclick = ddmenu_close;
</script>
 

Latest revision as of 08:00, 7 September 2018

   var timeout    = 500;
   var closetimer = 0;
   var ddmenuitem = 0;
        
   function ddmenu_open(){
       ddmenu_canceltimer();
          ddmenu_close();
          ddmenuitem = $(this).find('ul').css('visibility', 'visible');
   }
        
   function ddmenu_close(){ 
       if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
   }
        
   function ddmenu_timer(){
       closetimer = window.setTimeout(ddmenu_close, timeout);
   }
        
   function ddmenu_canceltimer(){  
       if(closetimer){  
           window.clearTimeout(closetimer);
               closetimer = null;
   }}
        
   $(document).ready(function(){  
       $('#ddmenu_hebrewu > li').bind('mouseover', ddmenu_open)
       $('#ddmenu_hebrewu > li').bind('mouseout',  ddmenu_timer)
   });
        
   document.onclick = ddmenu_close;