How to make the same window pop up in different directions, depending on the location of the parent in JS?
-
I have a slider. There are 6 columns and 2 rows visible. When you hover over each element, the element with the description is driven out of it. Leaves to the right. I don’t understand how to implement floating to the left when directing to elements closer to the right edge. Tell me please.JavaScript Lila Herrera, Aug 29, 2019
-
element.addEventListener("mouseover", function( ) {
if(element.clientX < element.clientWidth/2){
выход справа
}else{
выход слева
}
}, false);Anonymous -
Oleg I don’t know if I’m a fool or something is wrong here. Can't connect this wayAnonymous
2 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!