Using custom events for binding the same functionality for multiple pieces of code

/ Published in: JavaScript
Save to your folder(s)

Copy this code and paste it in your HTML
  1. $("div").bind("remove.pluginA", someFn);
  2. $("div").bind("remove.pluginB", otherFn);
  3. $("div").trigger("remove");

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.