开发者

slideToggle how to check whether it's opened or closed

开发者 https://www.devze.com 2023-03-05 06:32 出处:网络
I\'m us开发者_运维技巧ing slideToggle for a div. How i can check whether the slide is opened or closed?you can use

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

精彩评论

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