javascript - close any open flyout/dropdown when another is opened -
i have these 2 flyout menus toggle in , out , , down respectfully. when out occupy same space overlapping on each other. doesn't bad better if open menu closed when other clicked open. it's possible in future there more 2 menus. need solution when open menu simultaneously closes open menus. suppose need class relates them. i'm unclear on how close other open menus out closing 1 trying open @ moment. hope makes sense.
showfoowindow = function() { $('.channels-sessions-tab').click(function(){ var $cspane = $('.current-foo'); var panestate = parseint($cspane.css('left'),10) == 0 ? -$cspane.outerwidth()-11 : 0 $cspane.animate({ left: panestate }, { duration: 700, specialeasing: { width: 'linear', height: 'easeoutbounce' }}); }); }; showbarwindow = function() { $('.channel-session-tab').click(function(){ var $cspane = $('.current-bar'); var panestate = parseint($cspane.css('top'),10) == 0 ? -$cspane.outerheight()-11 : 0 $cspane.animate({ top: panestate }, { duration: 600, specialeasing: { width: 'linear', height: 'easeoutbounce' }}); }); };
try adding this:
$(".flownout")./*close flyouts*/.removeclass(".flownout"); $cspane.addclass("flownout"); $cspane.animate({ left: panestate }, { .... rest of code
Comments
Post a Comment