How to get the mouseovered half of an element
Today I'll write a very simple and short post about a very simple function that you can use to retrieve in which half (left/right) of an element the mouse is moving towards. The function is written in vanilla javascript, no frameworks are involved.
Given the element which captures the event and the event itself the function return the string 'left' or 'right' depending on the cursor position over the element.
/*
* Gets the mouseovered half of an element
...