开发者

How to check if it has class in jQuery?

How can I check if a the #load div has a class also?

if (cap > 20) {
$(".p" + (cap-9)).slideto({
    slide_durat开发者_JAVA技巧ion : 'slow'
});
}


you could try just adding a class to the button once it's been clicked:

$("#loadmore").click(function() {
    cap += 10;
    $(this).addClass("loadmore-clicked");
$(".p" + (cap-10)).addClass("loading");
setTimeout(function() {
    $(".p" + (cap-10)).removeClass('loading');
}, 7000);
    loadfeed();

});

And then just see if you have that class on the button below:

function loadfeed(){    
    if ($("#loadmore").hasClass("loadmore-clicked")){
      //loadmore was clicked
    }else{
      //loadmore hasn't been clicked
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜