Skip to content

Replacement for "one", which will run the bound event-handler once for EACH element that matches the selector.

Notifications You must be signed in to change notification settings

MoonScript/jquery-onFirst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

jquery-onFirst

Replacement for "one", which will run the bound event-handler once for each element that triggers the event, vs. current "one" that will run only once for the first element that triggers the event. jQuery >= 1.7 required (or 1.4.3 with on/off shim).

Example:

$(document).onFirst('focus', 'textarea.mywidget', function(){
  // hook up "mywidget"
});

Note: the only way to unbind this is to call "off" with the same event name and selector, without passing the handler.

About

Replacement for "one", which will run the bound event-handler once for EACH element that matches the selector.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published