Php Jquery:向上滑动div(如果最后一个)
我有这个朋友请求页面,我想要我的divPhp Jquery:向上滑动div(如果最后一个),php,javascript,jquery,Php,Javascript,Jquery,我有这个朋友请求页面,我想要我的div echo "<div style=' font-weight: bold; background: #283b43; border-bottom: 1px dashed #719dab;'>"; echo "<img src='images/NewFriend_small.png' style='float: left; margin-left: 25px; margin-right: 10px;'>"; echo "Friend
echo "<div style=' font-weight: bold; background: #283b43; border-bottom: 1px dashed #719dab;'>";
echo "<img src='images/NewFriend_small.png' style='float: left; margin-left: 25px; margin-right: 10px;'>";
echo "Friend requests";
echo "</div>";
当他们接受/拒绝朋友时:
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');
}
});
}
在jQuery中使用:last选择器
这就是您想要的吗?在jQuery中使用:last选择器 这就是你要找的吗
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');
}
});
}
$('div.friend:last').slideUp();