jQuery simpletip and hoverIntent (delay before showing the tooltip)
-
16-06-2021 - |
Вопрос
I have the same question like this:
Delay before showing the tooltip
I need a delay before showing the tooltip.
So i want to use the hoverIntent plugin.
I don't understand how to combine the two plugins.
$("#demo2 li").hoverIntent( makeTall, makeShort )
and
$("#demo2 li").simpletip()
together
$("#demo2 li").hoverIntent(
$("#demo2 li").simpletip("show"),
$("#demo2 li").simpletip("hide")
)
does not work for me.
Can anyone help, please?
Решение
var timeout = null;
$("#demo2 li").onmouseenter(function(){
clearTimeout(timeout);
timeout = setTimeout(function(){
$(this).fadeTo(1, "slow"); // or any other action
}, 300);
})
.onmouseleave(function(){
clearTimeout(timeout);
timeout = setTimeout(function(){
$(this).fadeTo(0.3, "fast"); // or any other action
}, 300);
});
Maybe a plugin for a calendar, or a nice dialog. But not for a delay on hovers.
Не связан с StackOverflow