Layer drag event : Draggable Layer « Ajax Layer « JavaScript DHTML






Layer drag event


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

var p = dynapi.document.addChild(new DynLayer(null,50,50,200,200,'silver'))
var a=p.addChild(new DynLayer(null,10,10,20,20,'red'))
DragEvent.enableDragEvents(a);
DragEvent.setDragBoundary(a, {left:5, right:5, top:5, bottom:5});

dynapi.onLoad(function() {
  str = '// Try these tests:\n\n'+
  'p.setSize(150,350);\n'+
  '//p.setSize(200,200);\n';
  dynapi.debug.setEvaluate(str);
});

</script>
</head>
<body bgcolor="#999999">

<script>
dynapi.document.insertAllChildren();
</script>

</body>
</html>

           
       








dynapi.zip( 791 k)

Related examples in the same category

1.Drag and Snap (SnapX)
2.Dragging Large Child Layers
3.Dragging Forms and Layers: form controls on a layer
4.Relative Layers : Drag & drop example
5.Inline layer drag and drop
6.Draggable Layers