Вопрос

I am using Hover indent plugin, This have only one function to combine mouse hover and mouse leave

Code1:

$("#tab").hoverIntent({
over: show, 
timeout: 20, 
out: hide
});
function show(){
$(".part").show();
}
function hide(){
$(".part").hide();
}

need write mouse leave function for .part, so made like this

Code2:

$("#tab").hoverIntent({
over: show, 
timeout: 20, 
out: hide
});
function show(){
$(".part").show();
}
$(".part").hoverIntent({
over: show, 
timeout: 20, 
out: hide
});
function hide(){
$(".part").show();
}    

but it seems error... how to fix this?

Это было полезно?

Решение

You can't remove any functions, because in hoverintent() the both show() and ehide() functions are used, make that function with empty like this

$("#tab").hoverIntent({
     over: show, 
     timeout: 20, 
     out: hide
});
function show(){
   $(".part").show();
}
function hide(){
}

$(".part").hoverIntent({
   over: show1, 
   timeout: 20, 
   out: hide1
});
function show1(){
}
function hide1(){
    $(".part").hide();
}

you must use different function names each show(),hide(),show1(),hide1() like this... try this

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top