javascript - toggle/visible check wrong behavior or a bug in the library -
i have section on call toggle() callback format. have noticed if visible check on child element of toggled section, opposite. instead of visible false.
i have following code fragments:
$('.section_advanced').toggle('fast',resizesection()); function resizesection() { console.log($('#responsibilitylevel').is(':visible')); if ($('#responsibilitylevel').is(':visible')) { } else { } }
where responsibilitylevel child of of .section_advanced section.
you need pass resizesection
function instead of calling it.
this:
$('.section_advanced').toggle('fast',resizesection());
should be:
$('.section_advanced').toggle('fast',resizesection);
Comments
Post a Comment