is there any framework (jquery, or anything else) or any java script which can handle this problem:
- if a link is clicked: open a popup
- if somebody clicks with: middle mouse click or with right-click: open in new tab, it should open in a new tab.
I can’t believe, there is no (complex) solution for it!
(and: would be nice if it’s working on IE7+, FF, Safari, Chrome)
You simply need to bind a handler for the
onclickevent that will callwindow.open()to open the new window. I haven’t tested in all browsers, but the ones I have tested in don’t fire theonclickevent when you use the middle (scrollwheel) or right mouse buttons.HTML:
jQuery: