jQuery: Detect Mouse Click and Open Target in New Tab

前端 未结 6 1913
暗喜
暗喜 2020-12-09 18:45

I\'m currently designing a simple forum application. It\'s mostly powered by jQuery/AJAX and loads everything on the same page; however, I know that sometimes users want to

6条回答
  •  一向
    一向 (楼主)
    2020-12-09 19:42

    The default action of the middle mouse button is to open in a new tab.

    You could set the hyperlinks target attribute to _blank to open a new tab.

    Link
    

    You can also refer to this question How to distinguish between left and right mouse click with jQuery

提交回复
热议问题