jQuery mouseout() 方法
jQuery 教程
· 2019-03-26 14:13:01
实例
当鼠标指针离开 <p> 元素时,设置背景色为灰色:
$("p").mouseout(function(){
$("p").css("background-color","gray");
});
$("p").css("background-color","gray");
});
定义和用法
当鼠标指针离开被选元素时,会发生 mouseout 事件。
mouseout() 方法触发 mouseout 事件,或添加当发生 mouseout 事件时运行的函数。
注意:与 mouseleave 事件不同,mouseout 事件在鼠标指针离开被选元素或任意子元素时都会被触发,mouseleave 事件只有在鼠标指针离开被选元素时被触发。参见页面底部演示实例。
提示:该事件通常与 mouseover 事件一起使用。
语法
触发被选元素的 mouseout 事件:
$(selector).mouseout()
添加函数到 mouseout 事件:
$(selector).mouseout(function)
| 参数 | 描述 |
|---|---|
| function | 可选。规定 mouseout 事件触发时运行的函数。 |
点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html
Programming Python
Mark Lutz / O'Reilly Media / 2006-8-30 / USD 59.99
Already the industry standard for Python users, "Programming Python" from O'Reilly just got even better. This third edition has been updated to reflect current best practices and the abundance of chan......一起来看看 《Programming Python》 这本书的介绍吧!