0
Hello,
I’m using the onContextMenu event with e.preventDefault()
, to create a custom menu. The problem is that if it is the "native" behavior of the browser, events like Scroll and Zoom are deactivative, and when using it in this way remain active. Is there any way to disable them?
That’s because I’m wearing a div com a position: fixed
, with a top
and a left
equal to pageX
and pageY
click event. When zooming, and scroll the div changes the position.
Note: I am using a reactjs environment.
This solution is almost perfect, I just needed to know if there is an event that detects the click outside of the browser, this because when doing the zoom works manually. So if it was possible to detect when it was clicked outside the page, hide the menu. Is there an event for this purpose? Thank you
– Cláudio Hilário
What exists is an event when the mouse leaves the page.
– Sam
And can you tell me what that event is? Thank you very much
– Cláudio Hilário
Seria
document.onmouseleave = function(){ }
– Sam
Thank you, it worked perfectly
– Cláudio Hilário