Js/jquery implement mouse Control page element explicit

Source: Internet
Author: User

Recently, because of the company's website to the previous campaign banner, when the user mouse across the display of the two-dimensional code. Like this mouse event control page element Explicit, the code farmers will often encounter, can be implemented by JavaScript or jquery code, below a few common needs to summarize together.

Mouseout and MouseLeave

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

<p style= "color: #333333; Font-family:-apple-system," FONT-SIZE:16PX; " = "" >
<! doctype html>


The effect is as follows:

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 effect is as follows:

Summary

In this paper, we learn to learn through the JS or JQ implementation of mouse events Control page element explicit effect, the method is very simple. If you have a better solution, you are welcome to discuss the exchange.





Js/jquery implement mouse Control page element explicit

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.