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

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -