GianlucaGuarini / jQuery.BlackAndWhite

Clientside grayscale images on any browser
http://gianlucaguarini.github.io/jQuery.BlackAndWhite/
Other
310 stars 131 forks source link

added custom events #39

Closed everyonesdesign closed 10 years ago

everyonesdesign commented 10 years ago

Hi there! This pull request will allow to change the state of images not only on mouseenter/mouseleave events but also on custom events. This is made with special custom events "BWon", "BWoff" and "BWtoggle" (the best method I considered for saving existing project structure).

The request includes: change of jquery.BlackAndWhite.js files, minified version change, readme addition and special demo page for this case.

GianlucaGuarini commented 10 years ago

Hi @everyonesdesign thanks for your pull request, but I don't think I will use jQuery custom events to trigger the b&w effect, even because you can achieve the same result just by doing:

$elm.trigger('mouseenter');

Anyway I think your idea is not that bad and soon I will publish a new version giving you a public API to trigger all the b&w internal events