This is my code:
// Close the bubble when we click on the screen.
document.addEventListener('mousedown', function (e) {
// if ain't right click
if(e.button != 2){
// hide
setTimeout("bubbleDOM.style.visibility = 'hidden';", 500);
}
}, false);
My probem is that when the user tries to scroll with the browser scroller the
setTimeout takes effect. How do i check that the mousedown isn’t in the scroller?
Make sure the button is left and make sure it’s not a bubbling event, not just if it’s not right. I’d suggest to also use a function in
setTimeout, so: