K
K
kevus2018-06-27 13:58:18
JavaScript
kevus, 2018-06-27 13:58:18

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

2 answer(s)
A
Anton Shvets, 2018-06-27
@Xuxicheta

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.

A
Alexander Aksentiev, 2018-06-27
@Sanasol

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 question

Ask a Question

731 491 924 answers to any question