jQuery mouseover() 方法

jQuery 教程 · 2019-03-26 14:27:08

实例

当鼠标指针位于 <p> 元素上方时,设置背景色为黄色:

$("p").mouseover(function(){
$("p").css("background-color","yellow");
});

定义和用法

当鼠标指针位于元素上方时,会发生 mouseover 事件。

mouseover() 方法触发 mouseover 事件,或添加当发生 mouseover 事件时运行的函数。

注意:与 mouseenter 事件不同,mouseover 事件在鼠标指针进入被选元素或任意子元素时都会被触发,mouseenter 事件只有在鼠标指针进入被选元素时被触发。参见页面底部演示实例。

提示:该事件通常与 mouseout 事件一起使用。

语法

触发被选元素的 mouseover 事件:

  
    $(selector).mouseover()

  

添加函数到 mouseover 事件:

  
    $(selector).mouseover(function)

  

参数 描述
function 可选。规定 mouseover 事件触发时运行的函数。

点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html

查看所有标签

Database Design and Implementation

Database Design and Implementation

Edward Sciore / Wiley / 2008-10-24 / 1261.00 元

* Covering the traditional database system concepts from a systems perspective, this book addresses the functionality that database systems provide as well as what algorithms and design decisions will......一起来看看 《Database Design and Implementation》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具