Jquery: Slide up div if last
<p>I have this friend request page, and i want my div </p>

<pre><code>echo "&lt;div style=' font-weight: bold; background: #283b43; border-bottom: 1px dashed #719dab;'&gt;";
echo "&lt;img src='images/NewFriend_small.png' style='float: left; margin-left: 25px; margin-right: 10px;'&gt;";
echo "Friend requests";
echo "&lt;/div&gt;";
</code></pre>

<p>To disappear too if it's the last friend request the user have.
Right now it doesnt do it, and only slide up the actual request (username, picture and so)</p>

<p>How should i check for if its the last friendrequest?</p>

<p>Right now its my code is like this</p>

<pre><code>    $friendsWaiting = mysql_query("SELECT * FROM users_friends where uID = '$v[id]' AND type = 'friend' AND accepted = '0'");
while($showW = mysql_fetch_array($friendsWaiting)){
echo "id: $showU[bID]";
}
</code></pre>

<p>JS when they accept/deny friend:</p>

<pre><code>function MeYouFriendNB(confirm){
 var c = confirm ? 'confirm' : 'ignore';
var fID = $('#fID').val();

    $.ajax({ 
       type: "POST",
       url: "misc/AddFriend.php",
    data: {
    mode: 'ajax',
        friend: c,
    uID : $('#uID').val(),
    fID : $('#fID').val(),
        bID : $('#bID').val()
    },
       success: function(msg){
$('#friend'+fID).slideUp('slow');
$('#Friendlist').prepend(msg);
 $('#theNewFriend').slideDown('slow');
        }
     });
}
</code></pre>
