how to catch mouse wheel on click event?

Discussion in 'JavaScript' started by abovesun, Nov 13, 2007.

  1. #1
    Сode:
    <a href="http://www.google.com" onclick="alert('test alert')">test</a>
    isn't work if user clicks on it in firefox to open it in another tab, actually it isn't work in IE and Opera either, how I can cath this wheel button click and hanle it???
    Edit/Delete Message
     
    abovesun, Nov 13, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    You can capture the onMouseUp event and check for button==1
    
    <a href="#" onmouseup="alert('button='+event.button);" >test</a>
    
    Code (markup):
     
    ajsa52, Nov 13, 2007 IP