How to make the same window pop up in different directions, depending on the location of the parent in JS?

  • 0
    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

  • 2 Answers
  • 0
    element.addEventListener("mouseover", function( ) {   
    if(element.clientX < element.clientWidth/2){
    выход справа
    }else{
    выход слева
    }
    }, false);
    Anonymous

  • 0
    Oleg I don’t know if I’m a fool or something is wrong here. Can't connect this way
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!