Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Last active December 28, 2015 03:09
Show Gist options
  • Select an option

  • Save walterdavis/7433430 to your computer and use it in GitHub Desktop.

Select an option

Save walterdavis/7433430 to your computer and use it in GitHub Desktop.
var submenus = $$('.submenu').invoke(
'setStyle',
'height: auto; max-height: 0; min-height: 0; overflow: hidden'
);
document.on('click', '#parentBoxId a', function(evt, elm){
evt.stop();
var target = $(elm.href.split('#').last());
if(target){
submenus.invoke('setStyle', 'max-height: 0');
target.morph('max-height: 900px');
}
});
document.on('click', '.submenu a', function(){
submenus.invoke('setStyle', 'max-height: 0');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment