I am using the below line to blink a block. It works but the callback function incre() is called immediately and does not wait till blinking is over.
I need to call incre() only after the animate function blinks 2 seconds. What am I missing?
block.attr({ opacity: 0.3 }).animate({ opacity: 1 }, 2000,incre());
For what you are attempting fadeTo() sounds like a good choice
Demo
However, the error in your codes are:
()(Brackets after the callback function name) i.e.incre()opacityis a CSS property not an attribute. so user.css()to manipulate themThe correct codes are:
Working Demo