html - Jquery accordion menu active open -


i have working jquery accordion menu. there 1 thing still not succeed. when open menu , click on link, menu closes again. want menu stays open, , closes when menu open.

sorry english. jquery code

$(document).ready(function(){           $('.item').click(function(){                 if($(this).css('max-height') == '37px') {                     $(this).css('max-height','240px')                 }else {                       $(this).css('max-height','37px')                 }           });     }); 

i hope can me.

here's jsfiddle html , css: http://jsfiddle.net/aan8n/

try instead

$('.kop').click(function(){         var $parent = $(this).parent(".item");          if($parent.css('max-height') == '24px') {             $(".item").css('max-height','24px');             $parent.css('max-height','240px');         }else {             $parent.css('max-height','24px');         } }); 

working demo


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -