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