开发者

jquery slideToggle - Call before slide

开发者 https://www.devze.com 2023-03-04 04:21 出处:网络
Can anyone suggest how to make a call within slideToggle before it opens/closes? Here is my situation:

Can anyone suggest how to make a call within slideToggle before it opens/closes? Here is my situation:

$('.accordion .d_row .c_row').live('click', function() 开发者_开发问答{

    $(this).nextAll('div.details').slideToggle(function() {

        if($(this).is(":hidden")){
            // do something
        } else {
            // do something
        }

    });
});

If i call anything where the //do something comment resides this getss fired whilst the element slides open. Is there a way to call, for example, a function first then perform the silde?

Cheers


You can just run your code before calling slideToggle.

0

精彩评论

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

关注公众号