📜  上下显示下拉菜单 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:57.838000             🧑  作者: Mango

代码示例1
let style = 'bottom';
let element = document.getElementById('myId');
if (window.innerHeight - element.getBoundingClientRect().bottom < element.scrollHeight){
     style = 'top'
}