devote / HTML5-History-API

HTML5 History API expansion for browsers not supporting pushState, replaceState
http://spb-piksel.ru
MIT License
1.02k stars 182 forks source link

Mouse wheel click #12

Closed dmvi closed 11 years ago

dmvi commented 11 years ago

When the mouse wheel click by link, by usual way it should be open in new tab. In your code it doesn't.

So i made this possible by few next strings.

// I pass aditional parameter 'e' in function $("a").click(function(e) {

// make check, if the button equals 1 it means that it's wheel, so open it in new tab. if( e.button == 1 ) { window.open( this.href, "_blank" ); return false; }

// at the end just make sure it's a left button, if it's not - exit of function. if ( e.button != 0 ) return true;

...

devote commented 11 years ago

Hi

How does this relate to the library HTML5-History-API?

dmvi commented 11 years ago

yeep, sorry. it's relate to example of using it.