Rico Drag and Drop - with dynamically created drop zones : Drag Drop « Rico « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Dojo toolkit
7. Event
8. Event onMethod
9. Ext JS
10. Form Control
11. GUI Components
12. HTML
13. Javascript Collections
14. Javascript Objects
15. Javascript Properties
16. jQuery
17. Language Basics
18. Mochkit
19. Mootools
20. Node Operation
21. Object Oriented
22. Page Components
23. Rico
24. Scriptaculous
25. Security
26. SmartClient
27. Style Layout
28. Table
29. Utilities
30. Window Browser
31. YUI Library
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
JavaScript DHTML » Rico » Drag Drop 
Rico Drag and Drop - with dynamically created drop zones
 
<!--
Apache License, Version 2.0

Revised from Rico 2.0  demo code.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>Rico</title>

<script src="rico21/src/rico.js" type="text/javascript"></script>
<script type='text/javascript'>
Rico.loadModule('Corner','DragAndDrop');

var dropCnt=1;
Rico.onLoadfunction() {
   dndMgr.registerDraggablenew Rico.Draggable('test-rico-dnd','dragme') );
   dndMgr.registerDropZonenew Rico.Dropzone('droponme') );
});

function CreateDropZone() {
  var div = document.createElement('div');
  var title = document.createElement('div');
  div.className='simpleDropPanel';
  title.className='title';
  dropCnt++;
  title.innerHTML='Drop On Me #'+dropCnt;
  div.appendChild(title);
  var id='dropzone'+dropCnt
  div.id=id;
  Element.setStyle(div, {backgroundColor:'#c6c3de'});
  document.body.appendChild(div);
  dndMgr.registerDropZonenew Rico.Dropzone(id) );
}
</script>

<style type="text/css">
body, p {
  font-family : Trebuchet MS, Arial, Helvetica, sans-serif;
}
h1 font-size: 16pt; }

div.title {
   font-family      : Arial;
   font-size        : 10px;
   background-color : #797979;
   color            : #ffffff;
   width            : 200px;
   margin           : 1px;
}
div.box {
   font-family   : Arial;
   font-size     : 14px;
   width         : 100px;
   height        : 40px;
   text-align    : center;
   border-bottom : 1px solid #6b6b6b;
   border-right  : 1px solid #6b6b6b;
}

div.panel {
   width    : 200px;
   height   : 80px;
   padding  : 2px;
   border   : 1px solid #5b5b5b;
}

div.simpleDropPanel {
   width    : 200px;
   height   : 80px;
   padding  : 2px;
   border   : 1px solid #5b5b5b;
   margin-top: 3px;
}
</style>
</head>


<body>

<h1 style='float:left;'>Rico Drag &amp; Drop - with dynamically created drop zones</h1>

<p style='clear:both;'><button onclick='CreateDropZone()'>Create Drop Zone</button></p>

<div style="padding:5px;border:1px solid #5b5b5b;height:50px;">
  <div class="box" style="background:#f7a673" id="dragme">Drag Me</div>
</div>

<div id="droponme" class="simpleDropPanel" style="background:#ffd773">
  <div class="title">Drop On Me</div>
</div>

</body>
</html>

   
  
Related examples in the same category
1. Rico Drag and Drop with Custom Drag Class
2. Rico Drag-and-Drop: LiveGrids
3. Track drop-and-drop objects as they are moved by the user
4. Rico Simple Drag and Drop Example
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.