开发者

toggle/visible check wrong behavior or a bug in the library

I have a section on which I call toggle() with the callback format. What I have noticed is that if I do a visible check on a child element of the togg开发者_如何学编程led section, that is always the opposite. Instead of visible I get false.

I have the following code fragments:

$('.section_advanced').toggle('fast',resizeSection()); 

function resizeSection() {
    console.log($('#responsibilityLevel').is(':visible'));
    if ($('#responsibilityLevel').is(':visible')) { 
    } else {        
    }
}

where responsibilityLevel is child of of the .section_advanced section.


You need to pass the resizeSection function instead of calling it.

This:

$('.section_advanced').toggle('fast',resizeSection());

should be:

$('.section_advanced').toggle('fast',resizeSection);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜