Home >Web Front-end >JS Tutorial >Use on method to bind hover event instance in JQuery_jquery

Use on method to bind hover event instance in JQuery_jquery

WBOY
WBOYOriginal
2016-05-16 16:27:571498browse

The text teaches you how to use the on method and simulate the hover method.

The code is as follows:

Copy code The code is as follows:

$(obj).on("mouseover mouseout",function(event){
if(event.type == "mouseover"){
//Mouse hover
}else if(event.type == "mouseout"){
//Mouse away
}
})

Hurry up and try it~

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