Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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'
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #How #determine #dropdown #show #upward #downward #direction
ADD COMMENT
Topic
Name
3+1 =