Js/jquery Implementing Mouse Event Control page element explicit (code instance)

Source: Internet
Author: User

This chapter gives you to use Js/jquery to realize the mouse event control page element Explicit effect, there is a certain reference value, the need for friends can refer to, I hope to help you.

First, mouseout and MouseLeave

For the mouse pointer to move in and out, it involves the mouseover, mouseout, and MouseLeave events.

MouseOver: The event is triggered when the mouse pointer moves over the target element;

Mouseout: This event is triggered when the mouse pointer moves out of the target element or its child elements;

MouseLeave: The event is triggered only when the mouse pointer moves out of the target element;

There is a need to pay special attention to the difference between mouseout and MouseLeave. Let's look at the following code example:

<! DOCTYPE html>


Ii. Fadein and Fadeout

The previous example uses the show () and Hide () method, the foreground explicit effect instantaneous completion, in order to improve the actual user experience, here we introduce two more friendly "friends", namely Fadein and fadeout.

FadeIn: Method uses a fade-in effect to display the target element.

FadeOut: Method uses fade effect to hide target elements

These two methods can be configured with parameters to control the speed, such as slow, normal, fast, or the specified number of milliseconds.

Here we compare the effects of show (), Hide () with Fadein (), FadeOut (), with the following code:

<! DOCTYPE html>

The mouse does not move up:

The mouse moves up:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.