I wanna pass an object from jquery using a selector to a javascript function like below.
flash($("#something span"), "#fff", 250);
but it does not seem to be working.
and I am not sure what to put in the javascript function. What I make now is:
function flash(obj,color1,color2,duration) {
obj.animate({backgroundColor:color1},duration);
setTimeout(function(){this.animate({backgroundColor:color2},duration);},duration);
}
or is there another way instead of passing an object? for example, in jquery: $("this").flash("#f79999", "#eee", 250);
but then how to define the javascript function?