I tried to create a dropdown menu, clicking on a toggle icon.
This is a jsFiddle with a very simplified example. The core of script is:
if( !$(target).hasClass('open') )
$(target).show().addClass('open');
else
$(target).removeClass('open').on('transitionend',function(e){
$(target).hide();
});
My problem is that submenu must appear with a transform:scale()
from 0 to 1, BUT I need that container (highlighed by red borders) adapt it's size depending by appereance of submenu.
Hiding it runs correctly with my code, but showing it does not fire scale
transition and I don't know how to solve...