Mouse Button Test : Mouse « Ajax Layer « JavaScript DHTML






Mouse Button Test


http://dynapi.sourceforge.net/
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999       
<html>
<head>
<title>Drag - Mouse Button Test</title>
<script language="JavaScript" src="./dynapisrc/dynapi.js"></script>
<script language="Javascript">
dynapi.library.setPath('./dynapisrc/');
dynapi.library.include('dynapi.api');
dynapi.library.include('DragEvent');
</script>
<script language="Javascript">

var lyr = new DynLayer(null,0,0,100,100,"e0e0e0");
lyr.addEventListener({
     ondragstart:function(e){
          status=e.getButton();
          if(e.getButton() == "right"){
               e.cancelDrag();
          }
     }
});

DragEvent.enableDragEvents(lyr);

dynapi.document.addChild(lyr);

dynapi.document.disableContextMenu();


</script>
</head>
<body>
You can drag and drop me with mouse left( and middle) button.
<script>
  dynapi.document.insertAllChildren();
</script>
</body>
</html>

           
       








dynapi.zip( 791 k)

Related examples in the same category

1.Add mouse down, over, up and out event to an image
2.Layer mouse event: move, click, over, exit, double click
3.Text selection on/off for mouse event
4.Get layer mouse click event
5.Mouse Click Speed Test (IE)