jQuery simpletip和hoverIntent(在显示工具提示之前的延迟)

时间:2012-06-21 08:07:03

标签: jquery hoverintent simpletip

我有同样的问题:

Delay before showing the tooltip

在显示工具提示之前我需要延迟。

所以我想使用hoverIntent插件。

我不明白如何组合这两个插件。

$("#demo2 li").hoverIntent( makeTall, makeShort )

$("#demo2 li").simpletip()

一起

$("#demo2 li").hoverIntent(
       $("#demo2 li").simpletip("show"),
       $("#demo2 li").simpletip("hide")
)

对我不起作用。

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

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);
});

可能是日历的插件,也可能是一个不错的对话框。但不是因为徘徊的延迟。