I am trying to fadeIn a background color in the beforeSend and fadeOut in the success with ajax. I don't know what I have done wrong. Help, please.
var data={
action: 'tag_user_update',
postSearchNonce : MyAjaxSearch.postSearchNonce,
tag : $(this).closest("a").text(),
users_id : $("#users_id").val()
}
$.ajax({
url: MyAjaxSearch.ajaxurl,
type:'POST',
cache: false,
data:data,
beforeSend: function() {
$('.tag_link').animate({ backgroundColor:'yellow'},'slow');
},
success: function(data){
$('.tag_link').animate({ backgroundColor:'white'},'slow');
}
});//ajax
Aucun commentaire:
Enregistrer un commentaire