开发者

slideToggle how to check whether it's opened or closed

I'm us开发者_运维技巧ing slideToggle for a div. How i can check whether the slide is opened or closed?


you can use

$('#divId').is(':visible');


You can try below:

$('#btn').click(function() {
    $('#content').slideToggle('slow', function () {
        if ($('#contentDetail2').is(':hidden')) {
            // some code when content is hidden
        }
        else {
            // some code when content is shown
        }
    });       
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜