Вопрос

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.

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