Home > Web Front-end > JS Tutorial > Solution to the problem of mouse left click conflict (preventing bubbling)_javascript skills

Solution to the problem of mouse left click conflict (preventing bubbling)_javascript skills

WBOY
Release: 2016-05-16 16:48:21
Original
1415 people have browsed it

I have implemented two right-click menus on one page. When the left button of the mouse clicks on a blank space, the right-click menu is not hidden. So, Google finally found a way to change the left mouse click event to:

Copy the code The code is as follows:

$(document).click( function () {
}


is changed to
Copy the code The code is as follows:

$(document).on('click touchstart', function () {
}


Problem solved.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template