I need to change the action of righ click and middle click to left click, so that when someone right clicks or middle clicks (mouse wheel click) inside a page, it will always act as a left click.
How is that possible?
I need to change the action of righ click and middle click to left click, so that when someone right clicks or middle clicks (mouse wheel click) inside a page, it will always act as a left click.
How is that possible?
require jquery
$(document).live('click', function(e) {
if( e.which != 1 )
{
var target = e.target;
target.click();
e.preventDefault();
}
});
this is my basic test on Fiddle hope it works for you
You can detect what button was clicked using the event.which property, f.ex:
document.onclick = function(e) {
alert(e.which);
};
1 is left, 2 and 3 is middle and right. Now add your own logic to that. If you need to normalize between browsers, I recommend jQuery for events.