[like hoverIntent() ]how to prevent a megaMenu from showing if timer<= VALUE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stephanie777
    New Member
    • Jan 2010
    • 3

    [like hoverIntent() ]how to prevent a megaMenu from showing if timer<= VALUE

    Hello,

    I don't want to implement the whole hoverIntent()
    (I'm not sure if it can easily be used in my site)

    here are some fragments of the code:

    Code:
     if (this.options.action == 'mouseover' || this.options.action == 'mouseenter') {
    				li.addEvent('mouseenter', function(e) {
    					if (li.hasClass ('group')) return;
    					$clear (li.timer);
    					this.itemShow (li);
    					e.stop();
    				}.bind (this));
    				
    				li.addEvent('mouseleave', function(e) {
    					if (li.hasClass ('group')) return;
    					$clear (li.timer);
    					if (li.childcontent) li.timer = setTimeout(this.itemHide.bind(this, [li, e]), this.options.delayHide);
    					else this.itemHide (li, e);
    					e.stop();
    				}.bind (this));
    			}
    I want to insert a code in line 4,
    similar to line 12
    where it makes this logic:

    if(time_of_mous e_over_menu_ite m <= 1000 ms)
    do not open menu
    else this.itemShow (li);


    PS, this code snippet can be found around line 213 in the attached file

    thanks in advance for your helps

    Regards
    Attached Files
Working...