Karmagination API
- DOM Methods
- Utilities
Events
Karmagination supports namespaced events but not custom events.
on( event, callback )
Binds an event to the element. The event can be namespaced.
<div>Hello!</div>
Karma('div').on('click.mynamespace', function(e, el){ alert($(el).html()); // alerts Hello! when clicked });
un( event, [callback] )
Unbinds an event to the elements.
Karma('div').un('click.mynamespace');
fire( event )
Simulates an event on the elements.
Karma('div').fire('click'); // simulates as if div is being clicked