Home > Web Front-end > JS Tutorial > JQuery's custom event code, triggering, binding simple instance_jquery

JQuery's custom event code, triggering, binding simple instance_jquery

WBOY
Release: 2016-05-16 17:27:27
Original
1080 people have browsed it

Custom event trigger
 

Copy code The code is as follows:

 $ event.trigger("myEventName" );

Custom event binding
The following code creates a binding to a custom event and will be executed when the custom event is triggered.
Copy code The code is as follows:

 $(this).bind("myEventName",function (){
 alert("myEventName triggered");
 });
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template