I work with dropdown menu, and this dropdown i have on the table.
But if is not enough place to open dropdown, it's not visible:
So i want to open this menu in up side, if in the bottom is no place enough, how i can do this?
My code - jsFiddle
Code for opening dropdown:
$(document).ready(function () {
Array.from(document.querySelectorAll('.custom-style')).forEach(function (menu_side) {
menu_side.onclick = ({
target
}) => {
if (!target.classList.contains('more')) return
document.querySelectorAll('.dropout.active').forEach(
(d) => d !== target.parentElement && d.classList.remove('active')
)
target.parentElement.classList.toggle('active');
}
});
});
I try to use few methods, but it's not works for me, now i sutck i have not idea how to fix this.
question from:
https://stackoverflow.com/questions/65880607/how-to-change-position-of-dropdown-if-menu-is-not-fit-on-the-screen-jquery 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…