$('.sub-menu').on('click', function(){
var menu = $(this).parents('.row').next()
$(menu).slideToggle();
var text = $(menu).is(':visible') ? 'open' : 'close';
$('.sub-menu-status').text(text);
});
For some reason it only outputs close
it never writes open
.
Inspected code and tried this variation but get the same result as above:
var text = $(menu).css('display') == 'none' ? 'open' : 'close';
Can someone help me understand this? Thanks.
jsFiddle update: http://jsfiddle.net/#&togetherjs=LlkSSawSsb