I'm currently trying to make an element blink 5 times with a loop so that I can replace current code. And this has to be replaced by a loop for requirements of class. My current code is
$(function(){
setTimeout(function() {
$(".blink").animate({opacity:0},700,"linear",function(){
$(this).animate({opacity:1},700);
$(this).animate({opacity:0},700);
$(this).animate({opacity:1},700);
$(this).animate({opacity:0},700);
$(this).animate({opacity:1},700);
$(this).animate({opacity:0},700);
$(this).animate({opacity:1},700);
$(this).animate({opacity:0},700);
$(this).animate({opacity:1},700);
});
}, 1000);
});
My last trial of using a loop on this function was
$(function(){
for (var i = 0; i < 4; i++) {
setTimeout(function() {
$(".blink").animate({opacity:0},700,"linear",function(){
$(this).animate({opacity:1},700);
});
}, 1000);
}
});
But it's only blinking one time... I have a feeling it's because "i" needs to be some place in the function, but I have yet to have success with any placements. Thanks