You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
When you do
$(this).css('display','none');
thethis
element disappears and any static or relative elements located in the DOM afterthis
, move up and occupy the area once used by thethis
element. They move up, because whatdisplay: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 thethis
element, but maintains the space there, causing no layout changes in the elements that follow.The text was updated successfully, but these errors were encountered: