Skip to content

Motionbox EventHandler Focus and Blur Bubbling Update

by Topper on October 31st, 2008

The Motionbox EventHandler ( http://github.com/tobowers/motionbox-eventhandler/tree/master ) now supports focus and blur bubbling. Based on this technique. Internet Explorer is supported too (behind the scenes it uses focusin and focusout, but you don't need to know that).

HTML:
  1. <form id="formy" action="#">
  2.   <input id="inputy1" name="inputy1" class="input_field" />
  3.   <input id="inputy2" name="inputy2" class="input_field" />
  4. </form>

JavaScript:
  1. // This now works:
  2. MBX.EventHandler.subscribe(".input_field", "blur", function (evt) { //do sometthing });
  3.  
  4. // Delegation on the form also works
  5. MBX.EventHandler.subscribe("#formy", "focus", function (evt) { //do something });

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS