Mestika
6/2/2015 - 5:00 AM

$.fn.on accepts an object: Did you know that $.fn.on accepts an object to attach multiple events at once? An example from the jQuery docs

$.fn.on accepts an object:

Did you know that $.fn.on accepts an object to attach multiple events at once? An example from the jQuery docs

$( "div.test" ).on({
  click: function() {
    $( this ).toggleClass( "active" );
  }, mouseenter: function() {
    $( this ).addClass( "inside" );
  }, mouseleave: function() {
    $( this ).removeClass( "inside" );
  }
});