Wednesday, 15 September 2010

jquery - mmenu custom width settings -



jquery - mmenu custom width settings -

is there way command width of mmenu pops out? changed css of

.mm-menu.mm-left { width: 250px; }

but still slides total 440px default size menu.

the css mmenu plugin created sass , there's mixin creates css sizing/positioning. can utilize mixin create new css file overrides default css.

this way, customized css file includes sizing-related css , update-proof.

to so, first create new scss file (for illustration "mmenu-my-custom-width.scss"), include "variables.scss" file , fire mixin custom sizes:

@import "path/to/inc/variables"; @include mm_sizing( ".my-custom-width", // additional classname menu. 0.8, 250, 250, // width, min-width, max-width 0.8, 250, 250 ); // height, min-height, max-height (for menus opened top/bottom)

second, run sass: http://sass-lang.com/ create css file.

third, fire plugin "mm-custom-width" in classes-option (older version) or "custom-width" in extensions-option (as of version 5.0.0):

$("#menu").mmenu({ classes: "my-custom-width", // older versions extensions: [ "custom-width" ] });

jquery mmenu

No comments:

Post a Comment