jQuery: Detect Mouse Click and Open Target in New Tab

前端 未结 6 1899
暗喜
暗喜 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:26

        $('#element').mousedown(function(event) {
              if(event.which == 3) { // right click
                  window.open("newlocation.html","");
              }
        });
    

    See it live http://jsfiddle.net/8CHTm/1/

提交回复
热议问题