美好的一天!
我有一个使用“selectize”插件的下拉选择。 如何根据屏幕高度设置下拉内容高度,因为我的下拉选择中有很多元素,所以最好将它们呈现在一个更长的列表中,而不仅仅是一个短列表。
期望的输出
我尝试使用下面的代码,只是在控制台上玩,但是它不起作用。
.selectize-dropdown, .selectize-dropdown.form-control{
height: -webkit-fill-available !important;
height: -moz-available !important;
height: fill-available !important;
}
.selectize-dropdown-content{
/* height: -webkit-fill-available !important;
height: -moz-available !important;
height: fill-available !important;*/
}
请给点建议,谢谢!
最佳答案
我设法达到预期的输出
.selectize-dropdown, .selectize-dropdown.form-control{
height: 90vh !important;
}
.selectize-dropdown-content{
max-height: 100% !important;
height: 100% !important;
}
关于javascript - 根据屏幕高度选择下拉高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46613111/