Home >Web Front-end >JS Tutorial >Code example of how to bind hover event using JQuery's on method

Code example of how to bind hover event using JQuery's on method

黄舟
黄舟Original
2017-06-26 11:08:311613browse

This article mainly introduces the use of on method to bind hover event examples in JQuery. This article is used in some special circumstances. Friends who need it can Refer to the

text below to teach you how to use the on method to simulate the hover method.

The code is as follows:

$(obj).on("mouseover mouseout",function(event){
 if(event.type == "mouseover"){
  //鼠标悬浮
 }else if(event.type == "mouseout"){
  //鼠标离开
 }
})

赶紧去



The above is the detailed content of Code example of how to bind hover event using JQuery's on method. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn