Answers for "How to determine dropdown should show upward or downward direction"

0

How to determine dropdown should show upward or downward direction

let style = 'bottom';
let element = document.getElementById('myId');
if (window.innerHeight - element.getBoundingClientRect().bottom < element.scrollHeight){
     style = 'top'
}
Posted by: Guest on October-11-2021

Code answers related to "How to determine dropdown should show upward or downward direction"

Code answers related to "Javascript"

Browse Popular Code Answers by Language