Share the bug_jquery animation that is continuously triggered and repeatedly executed by animations such as animate, slide, and fade in jQuery.

Source: Internet
Author: User
This article mainly introduces the relevant information about the continuous triggering and lagging execution of animations such as animate, slide, and fade in jQuery, if you need a friend, refer to the style in which I write an article. I like to start with a question and a question:

This is because I recently want to make an operation option for calling out, and then I thought of the method to hide it by default and display it when I move the mouse over it.

At the beginning, I planned to add a class = "active" and directly trigger the "add" and "remove" When mouseover (or mouseenter) is triggered. This solution is very simple and practical, however, the experience may not be so cool (well, the word is used, and it feels so low in an instant), so I thought of using the jQuery animations such as animate or slide, then I started to talk about the truth. This plug-in was written by myself and encountered some problems, which were not very well implemented (after all, js was not very well mastered). Then I listened to my colleagues to look for jquery, you can directly reference it after import.

(Fortunately, I didn't generate a special effect. The first reaction was to find a plug-in on the Internet. Speaking of this, I also thought of the solution that I met a few days ago about rolling the table header to the interface and fixing it. After a few days, I uploaded it and told you the truth, I did not find a proper solution after finding a circle on the Internet. Finally, I thought of a solution, but I still had a sense of achievement. Although it may not be the best solution)

Back to the topic, I found a circle on the Internet to tell the truth. Other people's plug-ins did a great job, and the compatibility under various browsers was also solved, but I personally, it is only used on two or three pages, and you have to import files (this does not seem to be particularly troublesome), but also use other people's services. In the end, there is no sense of accomplishment.

Then, I wrote it by myself. Although it took some time and encountered some problems, it was still good. The problem was finally solved, at least I am familiar with several built-in functions of jQuery.

Ps: finally, after I find the solution myself, I tried Baidu again. Well, the first webpage link that came out is the method I used.

Bug reproduction: It seems too troublesome to create an animation. Let's go to the code and know what the problem is like without looking at the animation; if you do not know the problem, copy the code first and try it.

PS: the following uses the animation as an example.

Test
 
 
 

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.