Jquery: Slide up div if last

ibnay

New Member
I have this friend request page, and i want my div \[code\]echo "<div style=' font-weight: bold; background: #283b43; border-bottom: 1px dashed #719dab;'>";echo "<img src='http://stackoverflow.com/questions/3587734/images/NewFriend_small.png' style='float: left; margin-left: 25px; margin-right: 10px;'>";echo "Friend requests";echo "</div>";\[/code\]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)How should i check for if its the last friendrequest?Right now its my code is like this\[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\]JS when they accept/deny friend:\[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\]
 
Back
Top