两个图层 红色图层代表outside蓝色图层代表inside
dom结构如下
<div id="outside">
     <div id="inside">
     </div>
</div>
样式为
#outside{width:300px; height:180px;position:relative;background:red;}
     #inside{width:400px; height:200px;position:absolute;left:50px;top:50px;background:blue;}
分别为这两个图层绑定事件 为mouseout  mouseover事件
jquery代码如下
$(function(){
$("#outside").hover(function(){
console.log("the mouse over outside");
},function(){
console.log("the mouse out outside");
});
$("#inside").hover(function(){
console.log("the mouse over inside");
},function(){
console.log("the mouse out inside");
});
});
分为以下几种情况(1-3是一个完整的移入移出过程)
(1)鼠标从outside层进入 输出信息为
the mouse over outside
(2)鼠标从outside移入inside时的输出信息为 
the mouse over inside
注意:这时并没有触发outside的mouseout事件 所以输出只有一条信息
(3)鼠标从inside移出 输出信息为
the mouse out inside
the mouse out outside
原因是事件冒泡机制
 
 
4-6是一个完整的移入移出过程
(4)鼠标从inside层进入的输出信息为
the mouse over inside
the mouse over outside
原因还是事件冒泡
(5)鼠标从inside移入outside(前提是从inside移入)输出的信息为
the mouse out inside 
这时不会输出the mouse over outside
(6)鼠标从outside移出 输出信息为
the mouse out outside
 
个人笔记 记录学习过程

mouseout以及mouseover的更多相关文章

  1. 【原创】解决鼠标经过子元素触发mouseout,mouseover事件的问题

    关键词:父子元素关系  mouseout  mouseover  事件  事件冒泡 初期代码: <!DOCTYPE html> <html> <head> < ...

  2. mouseout、mouseover和mouseleave、mouseenter区别

    今天在使用鼠标事件时,用错了mouseout,于是做个测试总结. 结论: mouseenter:当鼠标移入某元素时触发. mouseleave:当鼠标移出某元素时触发. mouseover:当鼠标移入 ...

  3. mouseout和mouseover、mouseenter和mouseleave

          在前端开发中经常会碰到当鼠标放到一个元素上时会弹出你一个元素,鼠标离开那个弹出元素后隐藏.这类效果一般要用到一些鼠标事件,一类是mouseout和mouseover,另一类是mouseen ...

  4. mouseleave,mouseout 和mouseover ,mouseenter区别

    鼠标离开事件: mouseleave:只有鼠标离开指定元素时才会触发; mouseout 鼠标离开指定元素或内部子元素都会触发; 鼠标在上事件: mouseover:只有鼠标进入指定元素时才会触发; ...

  5. 父级元素绑定定mouseout和mouseover,移过子元素是都会触发

    2019独角兽企业重金招聘Python工程师标准>>> mouseover与mouseenter 不论鼠标指针穿过被选元素或其子元素,都会触发 mouseover 事件. 只有在鼠标 ...

  6. 如何防止鼠标移出移入子元素触发mouseout和mouseover事件

    js代码: function isMouseLeaveOrEnter(e, handler) { var reltg=e.relatedTarget?e.relatedTarget:e.type==' ...

  7. 鼠标 mouseover和mouseout事件

    在div内想实现鼠标移入移出效果,最开始的时候是用了jquery的mouseout和mouseover事件来实现的, $('.product).mouseover(function(){ …… }). ...

  8. mouseover和mouseout闪烁问题

    在父级元素上注册了mouseover和mouseout事件后,当鼠标移动到子元素上时,会触发父级的mouseout和mouseover事件,反复触发,形成闪烁. 原因: 一种是由于冒泡,子级的mous ...

  9. jquery mouseout mouseover 多次执行

    用jquery,mouseout,mouseover,随着鼠标移动,事件被触发了多次(冒泡),换成js onmouseover,onmouseout也是一样.最终的解决办法是,用jquery,mous ...

随机推荐

  1. How do I implement a cancelable event?

    n System.ComponentModel, there's a class called CancelEventArgs which contains a Cancel member that ...

  2. DevExpress某些控件继承后的可编辑性

    今天在使用DevExpress的BarManager菜单控件时,发现在进行继承时无法在继承的子类窗体中对其进行编辑与修改,另外像GridView也有类似的情形,后来查阅资料后,现在可通过DevExpr ...

  3. Net文章汇总帖

    DevExpress:Data Grid ExamplesHow to: Initialize Cells in Newly Created RowsHow to: Set a Cell Value ...

  4. (medium)LeetCode 240.Search a 2D Matrix II

    Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the follo ...

  5. 第二章 D - Number Sequence(1.5.10)

    转载请注明出处:優YoU http://user.qzone.qq.com/289065406/blog/1301527312 大致题意: 有一串数字串,其规律为 1 12 123 1234 1234 ...

  6. fill的用法

    for(int i=0;i<=10;i++) num[i]=i ; fill(num+1,num+1+5,2) ; for(int i=0;i<=10;i++) printf(" ...

  7. C和C++头文件的不同

    #include <IOSTREAM.h>void main(){    std::cout<<"Hello,World!"<<std::end ...

  8. Android系统下检测Wifi连接互联网是否正常的代码

    /**  *  * 判断网络状态是否可用  *  * @return true: 网络可用 ; false: 网络不可用  */    public boolean isConnectInternet ...

  9. NSString用法

    1 创造字符串 NSString *str1 = @"hello"; NSString *str2 = [NSString string]; NSString *str3 = [N ...

  10. python的文件操作方法

    python中的文件对象:文件对象不仅可以用来访问普通的磁盘文件, 而且也可以访问任何其它类型抽象层面上的"文件". 一旦设置了合适的"钩子", 你就可以访问具 ...