首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Jquery鼠标管理鼠标

Jquery鼠标管理鼠标
EN

Stack Overflow用户
提问于 2011-10-26 10:55:10
回答 2查看 15.6K关注 0票数 2
代码语言:javascript
复制
<div id="div-1">I'm div-1</div>
<div id="div-2">I'm div-2</div>

JS

代码语言:javascript
复制
$("#div-1").bind('mouseover',function(event){
  $('#div-2').stop(true,true).fadeIn(100);
});
$('#div-2').bind('mouseleave', function(e) {
  $(this).stop(true,true).fadeOut(100);
});

我的问题是:如果我在#div-1中鼠标保存,我如何能够fadeOut #div-2?我目前使用的是jQuery1.2.6,无法更改版本。

编辑

小提琴手例子

EN

回答 2

Stack Overflow用户

发布于 2011-10-26 10:57:57

代码语言:javascript
复制
$("#div-1").bind('mouseover',function(event){
  $(this).stop(true,true).fadeIn(100);
  $('#div-2').fadeOut(100);
});
$('#div-1').bind('mouseleave', function(e) {
  $(this).fadeOut(100);
  $('#div-2').fadeIn(100);
});
票数 0
EN

Stack Overflow用户

发布于 2011-10-26 10:58:53

代码语言:javascript
复制
$("#div-1").bind('mouseover',function(event){
  $('#div-2').stop(true,true).fadeIn(100);
}).bind('mouseleave', function(event){
  $('#div-2').stop(true,true).fadeOut(100);
});
$('#div-2').bind('mouseleave', function(e) {
  $(this).stop(true,true).fadeOut(100);
});
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7901670

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档