Reputation: 139
Updated: Placed in the proper syntax as suggested, the below code now works!
I have a foreach generating rows of data inside a table. Each element has an id of rowX. I want my javascript to "slideup" the row of data after the Delete has been clicked.
If I use hide(); this works fine, but slideup(); is not working.
Any ideas?
<script type="text/javascript">
$("a.delete").click(function(e)
{
e.preventDefault();
var platform_id = $(this).attr('data-id');
var row = $(this).attr('id');
$.ajax({
type: "POST",
url: "platform/delete",
dataType: "json",
data: 'platform_id='+platform_id,
success: function(result){
if (result.success == 1)
{
$("#row" + row).slideUp('slow');
//document.getElementById(row).style.display = 'none'
}
},
error: function(result){
alert(result.message);
}
});
});
</script>
Upvotes: 2
Views: 398
Reputation: 73966
Try using this:
$("#row" + row).slideUp('slow');
// See the single qoutes here for slow effect
// Also `U` should be capital in slideUp
Instead of this:
$("#row" + row).slideup(slow);
Upvotes: 3
Reputation: 2738
The documentation for slideUp says slow
should be a string, i.e.
$("#row" + row).slideUp('slow');
Upvotes: 1