jQuery address plugin - Restoring what middle click did?
One of my biggest pet peeves with websites is when some genius developer comes along and drops Javascript actions ontop of all the links, entirely obliterating the mouse'开发者_StackOverflows middle-click (default action in most browsers: open a new tab with that page). Today, I am that genius developer.
I'm using the jQuery Address plugin from asual, which does everything I need it to really well, with the exception of treating my middle click as open link in new tab. It treats the middle click as a normal click. I can still open links in a new tab, but I have to use the menu-click and select "open in new tab".
How should I fix this behavior? If I don't get my middle click back, my OCD is going to jump me in a dark ally somewhere, and this vein down the side of my forehead is going to keep growing and growing.
...OK wow. You really love that middle click feature, LOL.
You can try to override the plugin:
$('#target').mousedown(function(e){
if(e.which == 2){
//Middle button clicked!
e.stopPropagation();
return true;
}
);
Or implement something similiar inside the original plugin's code.
精彩评论