GianlucaGuarini / jQuery.BlackAndWhite

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

Disable via jQuery selector? #60

Closed djtechonline closed 9 years ago

djtechonline commented 9 years ago

Great script, but I'm trying to find a way to undo/disable the effect on a particular selector? For example: If I call the script using $('#my_id').BlackAndWhite({ hoverEffect: true }); is there a way to stop the effect and revert back to the original color image with something like $('#my_id').BlackAndWhite({ disable: true }); ?

I was able to "trick" the script by inverting the effect and forcing a 'mouseleave' trigger as in the following: $('#my_id').BlackAndWhite({ invertHoverEffect: true }); $('#my_id').trigger('mouseleave');

The problem with this hack is that now, when I hover over the color image again, the b&w effect is still activated and not removed. Is there a better way?

GianlucaGuarini commented 9 years ago

Try with something like this http://jsfiddle.net/gianlucaguarini/qc8kcwps/