如何检查#load
div是否也有类?
if (cap > 20) {
$(".p" + (cap-9)).slideto({
slide_duration : 'slow'
});
}
答案 0 :(得分:0)
一旦点击按钮,你就可以尝试添加一个类:
$("#loadmore").click(function() {
cap += 10;
$(this).addClass("loadmore-clicked");
$(".p" + (cap-10)).addClass("loading");
setTimeout(function() {
$(".p" + (cap-10)).removeClass('loading');
}, 7000);
loadfeed();
});
然后看看下面按钮上是否有这个课程:
function loadfeed(){
if ($("#loadmore").hasClass("loadmore-clicked")){
//loadmore was clicked
}else{
//loadmore hasn't been clicked
}
}