I would like to activate a .mouseover function only if the mouse lays down on the "trigger" element for a predetermined duration (e.g. 500 milliseconds).

我想要激活一个.mouseover函数,只有当鼠标在“trigger”元素上放置一个预定的持续时间(例如500毫秒)。

E.g.

如。

$('.featured').mouseover(function () {
      $('.feat-txt').fadeOut("fast");
    });

Only if the mouse is positioned over the .featured element for at least 500 milliseconds period, the function can start and .feat-txt can FadeOut. A simple mouse over (just a quick movement) on that element doesn't activate the function.

只有当鼠标在. features元素上放置至少500毫秒时,函数才能启动,而.feature -txt可以淡出。在该元素上的简单鼠标(只是一个快速移动)不会激活函数。

Any suggestion on how to do that?

有什么建议吗?

3 个解决方案

#1


6

I have used hover intent in the past - pretty good and does what you're after I think:

我以前用过鼠标悬停的意图——很好,我想我做的是:

http://cherne.net/brian/resources/jquery.hoverIntent.html

http://cherne.net/brian/resources/jquery.hoverIntent.html

更多相关文章

  1. 动态添加表单元素,将它们存储到MySQL并在将来更改/删除它们
  2. 3.29 学前端 jquery之操作元素之属性操作
  3. jQuery循环没有每个和回调函数
  4. JavaScript函数中的Ruby代码
  5. 禁用焦点上的锚点()元素上的灰色边框
  6. 在jQuery中使用部分ID查找元素?(复制)
  7. jQuery.parseJSON()函数详解
  8. 使用数字作为javascript对象元素的名称
  9. 从内部获取函数名称

随机推荐

  1. 折叠式标题栏实现
  2. Android(安卓)安全和权限
  3. android:ADT 22.0.1 发布
  4. android之控件EditText学习
  5. Android 触屏事件处理_手势识别
  6. 简单安卓QQ登录界面
  7. android SQLite数据库存储数据
  8. 怎样成为一名Android开发者
  9. Android 内核开发初步
  10. android N多窗口和画中画属性