MaterializeCSS下拉菜单向上 [英] MaterializeCSS dropdown menu going upward
问题描述
我正在使用MaterializeCSS http://materializecss.com/dropdown.html 中的下拉菜单,但是我希望该菜单向上打开而不是向下打开.我可以通过选项执行此操作,还是必须直接在框架中更改某些内容?我试图在选项和其他选项中使用装订线,但它不起作用.
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.
推荐答案
这可以解决您的问题.
像这样
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
}
);
$('.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
}
);
这篇关于MaterializeCSS下拉菜单向上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!