Dragging Large Child Layers : Draggable Layer « Ajax Layer « JavaScript DHTML






Dragging Large Child Layers


http://dynapi.sourceforge.net/
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
<html>
<head>
<title>Dragging Large Child Layers</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 container = new DynLayer(null,0,0,200,200,"e0e0e0");
var insideObj = new DynLayer("Can drag until x & y=0. This due to boundrary  {left:0, right:0, top:0, bottom:0} and this layer being larger than it's parent",100,100,400,400, "lime"); // larger than our container...
container.addChild(insideObj);

DragEvent.setDragBoundary(insideObj, {left:0, right:0, top:0, bottom:0});
DragEvent.enableDragEvents(insideObj);

dynapi.document.addChild(container);

var container = new DynLayer(null,250,0,200,200,"e0e0e0");
var insideObj = new DynLayer("Can't drag due to boundrary  {left:0, right:0, top:0, bottom:0} and this layer being larger than it's parent",0,0,400,400, "yellow"); // larger than our container...
container.addChild(insideObj);

DragEvent.setDragBoundary(insideObj, {left:0, right:0, top:0, bottom:0});
DragEvent.enableDragEvents(insideObj);

dynapi.document.addChild(container);

</script>
</head>
<body>
<script>
  dynapi.document.insertAllChildren();
</script>
</body>
</html>

           
       








dynapi.zip( 791 k)

Related examples in the same category

1.Drag and Snap (SnapX)
2.Layer drag event
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