Answer the question
In order to leave comments, you need to log in
Is it possible to change the mouse button binding (JS)?
Hello. There is a link, the most common. Let's say:
Is it possible to make that when you click the left mouse button, the link opens with the command click on the wheel?
Thank you.
I would not have raised this issue if I had not stumbled upon the "reader" of the click: https://jsfiddle.net/dscshmg4/5/
Watch, you can observe - maybe you can influence.
<a href="link.html" target="_blank">Some text</a>
Answer the question
In order to leave comments, you need to log in
point 1. https://learn.javascript.ru/window-methods
point 2. You hang an event listener (click) on all links. Inside it event.preventDefault()
so that the browser does not follow the link.
when clicked, create a new window with a link.
At the same time, immediately call the focus setting in the parent window so that it remains active.
Not the fact that it will work, browsers can block such a chain of actions. this is mostly used by spammers/popunders etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question