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? Link to comment https://forums.phpfreaks.com/topic/115107-jquery-fade-slide/ 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() Link to comment https://forums.phpfreaks.com/topic/115107-jquery-fade-slide/#findComment-591946 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"}); } } }); } Link to comment https://forums.phpfreaks.com/topic/115107-jquery-fade-slide/#findComment-591947 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() Link to comment https://forums.phpfreaks.com/topic/115107-jquery-fade-slide/#findComment-591950 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 Link to comment https://forums.phpfreaks.com/topic/115107-jquery-fade-slide/#findComment-591956 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? Link to comment https://forums.phpfreaks.com/topic/115107-jquery-fade-slide/#findComment-591963 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 Link to comment https://forums.phpfreaks.com/topic/115107-jquery-fade-slide/#findComment-591975 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. Link to comment https://forums.phpfreaks.com/topic/115107-jquery-fade-slide/#findComment-591987 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. Link to comment https://forums.phpfreaks.com/topic/115107-jquery-fade-slide/#findComment-592574 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.