www.webdeveloper.com
Results 1 to 2 of 2

Thread: Not work on IE

  1. #1
    Join Date
    Aug 2012
    Posts
    3

    Not work on IE

    The below code work well on Crome but not in IE
    Code:
    <script language=JavaScript>
    var sTestEventType='mousedown';
    function handleMouseEvent(e) {
    var evt = (e==null ? event:e);
    if (evt.type!=sTestEventType) return true;
    if (evt.which==1)  return true; 
    return false;
    }
    document.onmousedown=handleMouseEvent;
    document.onmouseup=handleMouseEvent;
    document.onclick=handleMouseEvent;
    </script>
    Can anyone help to modified it to work in IE. Thanks

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,653
    try this

    var evt = (e==null ? event:e); ----> var evt = window.event? window.event:e;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles