-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
When you do $(this).css('display','none'); the this element disappears and any static or relative elements located in the DOM after this, move up and occupy the area once used by the this element. They move up, because what display:none does is hiding the element AND removing the layout space occupied by it.
However, in your code you show and hide the element so fast, that produces no noticeable flickering. But the most important thing: The elementFromPoint() might in fact not read the element underneath, but the sibling element that got just moved up.
You should use $(this).css('visibility','hidden'); instead. It also hides the this element, but maintains the space there, causing no layout changes in the elements that follow.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels