I want to fade out a set of div's based on the ajax response. This code isn't doing what I wanted.
What am I doing wrong?
$('.view_result').click(function() {
$('.result_bar').fadeIn();
var set = $('.result_bar');
for(var i = 0; i < set.length; i++) {
$.post('get_votes.php', {'id':$(set[i]).attr('name')}, function(data) {
$('.result_bar')[i].fadeOut(); //--> Didn't Work
$(set)[i]).fadeOut(); //--> Didn't Work
set[i].fadeOut();// --> Didn't Work
});
}
return false;
});