I've tried a ton of different methods to get the obj var within my plugin to add classes on click instead of hover but nothing seems to work.. obj.click(function() { seems to work with older versions of jQuery like 1.4.2 but not anything newer.. any suggestions would be highly appreciated
thank you!
(function($) {
$.fn.vivify = function(options) {
var defaults = {
animation: 'bounce',
};
var options = $.extend(defaults, options);
return this.each(function() {
var o = options;
var obj = $(this);
var animation = o.animation;
obj.hover(function() {
obj.addClass(o.animation);
obj.addClass('vivify');
},
function() {
obj.removeClass(o.animation);
});
})
}
})(jQuery);