rofl90 Posted July 16, 2008 Share Posted July 16, 2008 I'm trying to use ajax to delete a row from a table - which works, but it'd like for it to go red on failure and fade out, and all other rows slide up on success, i'm already able to get a response, just not the affects. any advise? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 what does your JS look like so far? you should just be able to set the TR background to red, then doing a fadeOut() Quote Link to comment Share on other sites More sharing options...
rofl90 Posted July 16, 2008 Author Share Posted July 16, 2008 the fade out won't invoke the slide upwards: part of the object: deleteThis:function(id) { $.ajax({ type: "GET", url: "statsAjax.php", data: "delAction=" + id, success: function(msg){ if(msg == "done") { $("#starBar-"+id).animate({'background-color':"green"}, 2000).fadeOut("slow"); } else { $("#starBar-"+id).animate({'background-color':"green"}, 2000).animate({'background-color':"none"}); } } }); } Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 well...do you want it to fade or slide? after the fade, the TR (i assume it's a TR) should disappear and the gap between the rows should close. does it not do that? if you want it to slide, use slideUp() instead of fadeOut() Quote Link to comment Share on other sites More sharing options...
rofl90 Posted July 16, 2008 Author Share Posted July 16, 2008 it does dissapear, but they don't slide up Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 16, 2008 Share Posted July 16, 2008 so...to clarify, you want it to fade out then slide up the empty space instead of just disappearing? Quote Link to comment Share on other sites More sharing options...
rofl90 Posted July 16, 2008 Author Share Posted July 16, 2008 i want it to fade out (by dissapearing, but gradually), and i want all the <tr>'s below it to slide up Quote Link to comment Share on other sites More sharing options...
rofl90 Posted July 16, 2008 Author Share Posted July 16, 2008 I presume it would be something to do with a loop of all ids higher than the one deleted. Quote Link to comment Share on other sites More sharing options...
rofl90 Posted July 17, 2008 Author Share Posted July 17, 2008 ok, so it works, but it doesn't have a chance to slide up, as, as soon as it tries to slide up, the top bit comes down, because there is nothing there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.