I first see the JQ API documents did not find a way, no results have to find some information on the Internet, sure enough to find a live method.
It's actually very simple:
1. This is the effect of the project requirements, when I did not use the live event, only a simple hover event: The hover event did not load in, no I want the border effect, the effect is as follows
Copy Code code as follows:
* * Through the user skills tag to increase the style * *
$ (function () {
$ (". s-edited"). Hover (function () {
$ (this). Toggleclass ("Borderd");
})
})
2. When I used live, the effect reached, the following figure:
The code is as follows:
Copy Code code as follows:
* * Through the user skills tag to increase the style * *
$ (". s-edited"). Live ("hover", function () {
$ (this). Toggleclass ("Borderd");
})
I took a close look at the introduction to live,
Bind an event handler function (such as a hover event) to all current and future elements that will match. Custom events can also be bound.
PS: I am a novice rookie, big God not to spray!
The above is the entire content of this article, I hope you can enjoy.