Code: Select all
document.addEventListener("mousedown", pan.startScroll, true);
document.addEventListener("mousemove", pan.scroll, true);
document.addEventListener("mouseup", pan.endScroll, true);
document.addEventListener("mousewheel", pan.mouseWheel, false);Why I need this is for a bookmarklet I've been working on, which allows you to scroll and pan a webpage with the middle mouse button. Google Chrome does have a middle mouse button feature like this, so that's why I built the bookmarklet.
Here is the bookmarklet if you'd like to give it a spin. Just don't use it regularly, YOU DO NOT HAVE MY PERMISSION! Don't even keep the bookmarklet unless I say you can.
So as you can see if you start the middle mouse click on a link after the panning the link will open in a new tab. I need some help figuring out how to thwart this when panning.javascript:(function(){if(typeof pan=="undefined"){var script=document.createElement("script");script.type="text/javascript";script.src="http://bookmarklets.freehostia.com/pan. ... ld(script);}}})()
I appreciate any help on this.