marghoobsuleman/ms-Dropdown — pull request #38 by tkareine (2012-11-05 15:21:46+00:00)
Title: Fix event handler compatibility with jQuery 1.8

Now event handlers can be passed via msDropDown constructor.

This allows operation with jQuery 1.8, which does not give access to registered event handlers via `$.fn.data('events')` anymore.

Instead of passing event handlers as constructor parameters, we could use `$._data(element, 'events')`, but because that belongs to [jQuery's internal API](http://blog.jquery.com/2012/08/09/jquery-1-8-released/), it is not guaranteed to be supported in the future.

Explicit callback usage:

$(selector).msDropDown({ events: { change: changeHandler } })

Implicit callback usage:

$(selector).on('change, changeHandler)
$(selector).msDropDown({ events: { change: true } })

Please see example page `event_handlers_in_jquery18.html`.