javascript - Slide Over Menu combined with Bootstrap -
i trying create similar effect, can click on hamburger icon , menu slides out: http://tympanus.net/tutorials/googlenexuswebsitemenu/
i don't need hover event, click.
my problem in above example, there space allocated menu live. in situation, need main content shrink make room menu. so, using bootstrap, switching main content "col-md-12" class "col-md-11" class, menu "col-md-1" class can fit:
$('#toggle').mousedown(function () { $('#mainmenu').toggleclass('col-md-1'); $('#mainmenu').toggleclass('zero'); $('#maincontent').toggleclass('col-md-12'); $('#maincontent').toggleclass('col-md-11'); }); i have attempted here: http://jsfiddle.net/955rv/
but it's not quite right. negative margin trick because i'm not sure how else bring in menu left. not happy right side of content shrinking in animation before menu appears , prefer happen simultaneously. guess technically happening simultaneously, margin animation takes longer complete width animation.
any appreciated. let me know if can clarify anything.
this looks great place start:
http://tympanus.net/blueprints/slidepushmenus/
notice difference between "push" , "slide" type menus. looking "push."
code explained here: http://tympanus.net/codrops/2013/04/17/slide-and-push-menus/
Comments
Post a Comment