Inline layer drag and drop : Draggable Layer « Ajax Layer « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Event
7. Event onMethod
8. Form Control
9. GUI Components
10. HTML
11. Javascript Collections
12. Javascript Objects
13. Language Basics
14. Node Operation
15. Object Oriented
16. Page Components
17. Security
18. Style Layout
19. Table
20. Utilities
21. Window Browser
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
JavaScript DHTML » Ajax Layer » Draggable Layer 
Inline layer drag and drop


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

var mylayer = dynapi.document.addChild(new DynLayer(),null,'mylayer');
mylayer.addChild(new DynLayer(),'lyrBox1','box1');
mylayer.addChild(new DynLayer(),'lyrBox2','box2');
mylayer.addChild(new DynLayer(),'lyrBox3','box3');
mylayer.addChild(new DynLayer(),'lyrBox4','box4');

DragEvent.enableDragEvents(
  mylayer,
  mylayer.lyrBox1,
  mylayer.lyrBox2,
  mylayer.lyrBox3,
  mylayer.lyrBox4
);

var el = {
  onmousedown : function(e) {
    dynapi.debug.print('mousedown on '+e.getSource().id)
    e.preventBubble();
  }
}

mylayer.addEventListener(el);

</script>
<style type="text/css">
<!--

#mylayer {position:absolute; left:250px; top:50px; width:200px; height:200px; clip:rect(0px 200px 200px 0px); background-color:red; layer-background-color:red;}
#box1 {position:absolute; left:0px; top:0px; width:20px; height:20px; clip:rect(0px 20px 20px 0px); background-color:yellow; z-index:5; layer-background-color:yellow;}
#box2 {position:absolute; left:180px; top:0px; width:20px; height:20px; clip:rect(0px 20px 20px 0px); background-color:blue; z-index:5; layer-background-color:blue;}
#box3 {position:absolute; left:180px; top:180px; width:20px; height:20px; clip:rect(0px 20px 20px 0px); background-color:silver; z-index:5; layer-background-color:silver;}
#box4 {position:absolute; left:0px; top:180px; width:20px; height:20px; clip:rect(0px 20px 20px 0px); background-color:green; z-index:5; layer-background-color:green;}

-->
</style>
</head>
<body bgcolor="#FFFFFF">
<div id="mylayer">
<table border="0" height="200" width="200"><tr><td align="center"><font color="#ffffff">My Inline Widget<br>Drag Me</font></td></tr></table>
  <div id="box1"></div>
  <div id="box2"></div>
  <div id="box3"></div>
  <div id="box4"></div>
</div>

</body>
</html>


           
       
dynapi.zip( 791 k)
Related examples in the same category
1. Drag and Snap (SnapX)
2. Layer drag event
3. Dragging Large Child Layers
4. Dragging Forms and Layers: form controls on a layer
5. Relative Layers : Drag & drop example
6. Draggable Layers
w___w___w__.ja__v_a_2s__.__com___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.