Home >Web Front-end >JS Tutorial >Getting started with JQuery - Introduction to the application of hover() method for event switching_jquery

Getting started with JQuery - Introduction to the application of hover() method for event switching_jquery

WBOY
WBOYOriginal
2016-05-16 17:42:141111browse

1. In JQuery , there are two methods for event switching, one method is hover() and the other is toggle(). The so-called switching event means that two or more events are bound to an element to switch between the behaviors of the element. For example, if a hyperlink tag wants to trigger an event when the mouse is hovering, and another event when the mouse is moved out, it can be easily achieved by using a switch event.

2. Sample code :

Copy code The code is as follows:





Switch event hover





Introduction to JQuery

JQuery is an open source project created by American John Resig in 2006. Its main purpose is to achieve more functions with less code




3. Rendering preview :


When the mouse moves to the JQuery introduction:

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