两个图层 红色图层代表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. 【转】windows和linux间共享互传文件

    原文:http://blog.guorunmin.cn/2015/09/16/windows%E5%92%8Clinux%E9%97%B4%E5%85%B1%E4%BA%AB%E4%BA%92%E4% ...

  2. 《Code Complete》ch.29 集成

    WHAT? 集成是这样一种软件开发行为:将一些独立的软件组合为一个完整的系统. WHY? 更容易诊断缺陷 尽早获得一个可工作的产品 更好的顾客关系 增强士气 更可靠地估计进度表 更准确的现状报告 HO ...

  3. The Ninth Hunan Collegiate Programming Contest (2013) Problem G

    Problem G Good Teacher I want to be a good teacher, so at least I need to remember all the student n ...

  4. jmeter随笔(11)--上传文件接口出错

    点击标题下「飞测」可快速关注 坚持的是分享,搬运的是知识,图的是大家的进步,没有收费的培训,没有虚度的吹水,喜欢就关注.转发(免费帮助更多伙伴)等来交流,想了解的知识请留言,给你带来更多价值,是我们期 ...

  5. [UI]Flat UI - Free Boorstrap Framework and Theme

    ---------------------------------------------------------------------------------------------------- ...

  6. Docker学习总结之docker介绍

    About Docker 以下均翻译自Docker官方文档 ,转载请注明:Vikings翻译 Develop, Ship and Run Any Application, Anywhere Docke ...

  7. Centos安装arm-linux-gcc等交叉工具链

    1.安装(仅以其中一个为例) 1.1 下载arm-linux-gcc (搜一下,很多的!) 1.2 解压:指定解压到根目录 tar xvzf arm-linux-gcc-4.4.3.tar.gz -C ...

  8. USACO Section 2.2 循环数 Runaround Numbers

    OJ:http://www.luogu.org/problem/show?pid=1467 #include<iostream> #include<vector> #inclu ...

  9. openGL 提升渲染性能 之 顶点数组 VBO IBO VAO

    使用openGL图形库绘制,都需要通过openGL接口向图像显卡提交顶点数据,显卡根据提交的数据绘制出相应的图形. openGL绘制方式有:直接模式,显示列表,顶点数组,顶点索引. 直接模式:最简单, ...

  10. 使用Cookie保存商品浏览记录

    数据流程:页面上是商品列表,点击<a href="productServlet">商品名</a> ==>跳转到自定义的servlet中进行处理,先得到 ...