问题
I'm using dropdown menu from MaterializeCSS http://materializecss.com/dropdown.html but I want that menu to open upward not downward. Can I do this via options or I will have to change some stuff direct in the framework? I tried to use gutter in options and other options and it does not work.
回答1:
This may solve your problem.
set it true like this belowOrigin: true, // Displays dropdown below the button
$('.dropdown-button').dropdown({
inDuration: 300,
outDuration: 225,
constrainWidth: false,
gutter: 0, // Spacing from edge
belowOrigin: true, // Displays dropdown below the button
alignment: 'left', // Displays dropdown with edge aligned to the left
stopPropagation: false // Stops event propagation
}
);
来源:https://stackoverflow.com/questions/38746509/materializecss-dropdown-menu-going-upward