JavaScript DHTML/Ajax Layer/Drag Effects

Материал из Web эксперт
Перейти к: навигация, поиск

Delayed draggable and Delayed sortable

<!-- 
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>script.aculo.us functional test</title>
  <script type="text/javascript" src="./scriptaculous-js-1.6.4src/prototype.js"></script>
  <script type="text/javascript" src="./scriptaculous-js-1.6.4src/effects.js"></script>
  <script type="text/javascript" src="./scriptaculous-js-1.6.4src/dragdrop.js"></script>
  <script type="text/javascript">
   var myStartEffect = function(element) {
     element._opacity = Element.getOpacity(element);
     new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
     new Effect.Highlight(element, {});
   }
  </script>
  <style type="text/css">
   h1 {font-size: 1.2em; text-align:center;}
   li {
           margin: 5px auto;
           padding: 2px;
           width: 200px;
           text-align:center;
           list-style-type:none;
           border: 2px solid #779;
           background-color: #dde
   }
   div {
           margin: 5px auto;
           padding: 2px;
           width: 300px;
           text-align:center;
           border: 2px solid #797;
           background-color: #ded
   }
  </style>
</head>
<body>
  <h1>No delay sortable</h1>
  <ul id="sort1">
    <li id="s1_1">one</li>
    <li id="s1_2">two</li>
    <li id="s1_3">three</li>
  </ul>
  <h1>Delayed sortable (500 ms)</h1>
  <ul id="sort2">
    <li id="s2_1">one</li>
    <li id="s2_2">two</li>
    <li id="s2_3">three</li>
  </ul>
  <h1>No delay draggable</h1>
  <div id="drag1">
    Lorem ipsum
  </div>
  <h1>Delayed draggable (1000 ms)</h1>
  <div id="drag2">
    Lorem ipsum
  </div>
  
  <script type="text/javascript" charset="utf-8">
    Sortable.create("sort1", {starteffect: myStartEffect});
    Sortable.create("sort2", {starteffect:myStartEffect, delay:500});
    new Draggable("drag1", {starteffect:myStartEffect});
    new Draggable("drag2", {starteffect:myStartEffect, delay:1000});
  </script>
</body>
</html>


<A href="http://www.wbex.ru/Code/JavaScriptDownload/scriptaculous-js-1.6.4.zip">scriptaculous-js-1.6.4.zip( 139 k)</a>


Drag from this table, Drop on this table

<!-- 
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<html>
<head>
<title>Drag &amp; Drop</title>
<style type="text/css">
td
{
 width: 10em;
 text-align: center;
}
table.mytable {
  list-style-type: none;
  padding: 4px 4px 0 4px;
  margin: 0px;
  font-size: 13px;
  font-family: Arial, sans-serif;
}
table.mytable tr {
  margin-bottom: 4px;
  padding: 2px 2px;
  border: 1px solid #c00;
  background-color: #eee;
}
div.draggable {
  cursor:move;
  padding:2px;
  background-color: #BBCCDD;
}
div.dropsite {
  padding:2px;
  background-color: #DDBB99;
}
div.hoverclass123
{
  border:1px solid red;
}
</style>
<script language="JavaScript" type="text/javascript" src="./scriptaculous-js-1.6.4src/prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="./scriptaculous-js-1.6.4src/scriptaculous.js"></script>
<script language="JavaScript" type="text/javascript">
Position.includeScrollOffsets = true;
window.onload = function()
{
  var t1 = document.getElementById("t1");
  add_divs(t1, "td", "draggable");
  var trs = t1.getElementsByTagName("tr");
  for (var i = 0; i < trs.length; i++)
  {
    var divs = document.getElementsByClassName("draggable", trs[i]);
    var drag_text = divs[2].innerHTML;
    for (var j = 0; j < divs.length; ++j)
    {
      new Draggable(divs[j], {ghosting:true, revert:true});
    }
  }
  var t2 = document.getElementById("t2");
  add_divs(t2, "td", "dropsite");
  var divs = document.getElementsByClassName("dropsite", t2);
  for (var j = 0; j < divs.length; ++j)
  {
    Droppables.add(divs[j], {accept:"draggable",
                   hoverclass:"hoverclass123",
                   onDrop:function(element, dropon, event)
                     { debug("dropped " + element.innerHTML + " on "
                          + dropon.innerHTML + "\n")}});
  }
};
function debug(text)
{
   document.getElementById("debug").innerHTML
       = "<pre>" + text + "</pre>";
}
function add_divs(table, tag, classname)
{
  var items = table.getElementsByTagName(tag);
  for (var i = 0; i < items.length; i++)
    items[i].innerHTML =
      "<div class="" + classname + "">" + items[i].innerHTML + "</div>";
}

</script>
</head>
<body>
<p>Drag from this table:</p>
<DIV STYLE="padding-left: 50pt;">
<DIV STYLE="overflow: auto; width: 250; height: 100;
            border: 1px gray solid;
            padding:0px; margin: 0px;">
<table id="t1" class="sortable mytable">
    <tr><td>one</td><td>1</td><td>uno</td></tr>
    <tr><td>two</td><td>2</td><td>dos</td></tr>
    <tr><td>three</td><td>3</td><td>tres</td></tr>
    <tr><td>four</td><td>4</td><td>quatro</td></tr>
    <tr><td>five</td><td>5</td><td>cinco</td></tr>
    <tr><td>six</td><td>6</td><td>seis</td></tr>
    <tr><td>seven</td><td>7</td><td>siete</td></tr>
    <tr><td>eight</td><td>8</td><td>ocho</td></tr>
    <tr><td>nine</td><td>9</td><td>nueve</td></tr>
    <tr><td>ten</td><td>10</td><td>diez</td></tr>
</table>
</DIV>
</DIV>
<p>
<p>Drop on this table:</p>
<DIV STYLE="padding-left: 50pt;">
<DIV STYLE="overflow: auto; width: 250; height: 100;
            border: 1px gray solid;
            padding:0px; margin: 0px;">
<table id="t2" class="sortable mytable">
    <tr><td>eleven</td><td>11</td><td>once</td></tr>
    <tr><td>twelve</td><td>12</td><td>doce</td></tr>
    <tr><td>thirteen</td><td>13</td><td>trece</td></tr>
    <tr><td>fourteen</td><td>14</td><td>catorce</td></tr>
    <tr><td>fifteen</td><td>15</td><td>quince</td></tr>
    <tr><td>sixteen</td><td>16</td><td>dieciseis</td></tr>
    <tr><td>seventeen</td><td>17</td><td>diecisiete</td></tr>
    <tr><td>eightteen</td><td>18</td><td>dieciocho</td></tr>
    <tr><td>nineteen</td><td>19</td><td>diecinueve</td></tr>
    <tr><td>twenty</td><td>20</td><td>veinte</td></tr>
</table>
</DIV>
</DIV>
<p>
<div id="debug"></div>
</p>
</body>
</html>


<A href="http://www.wbex.ru/Code/JavaScriptDownload/scriptaculous-js-1.6.4.zip">scriptaculous-js-1.6.4.zip( 139 k)</a>


Drag hover effects

<!-- 
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<html>
<head>
<title>script.aculo.us Drag and drop functional test file</title>
<script src="./scriptaculous-js-1.6.4src/prototype.js" type="text/javascript"></script>
<script src="./scriptaculous-js-1.6.4src/scriptaculous.js" type="text/javascript"></script>
<script src="./scriptaculous-js-1.6.4src/unittest.js" type="text/javascript"></script>
</head>
<style>
  div.hoverclass123 {
    border:1px solid red;
  }
</style>
<body>
<h1>script.aculo.us Drag and drop functional test file</h1>
<h2>w/o hoverclass</h2>
<div id="cart" class="cart" style="text-align:center;height:50px;padding:10px;background-color:#fba">
### DROP HERE ###
</div>
<script type="text/javascript">Droppables.add("cart", {onDrop:function(element,dropon){alert("w/o hoverclass, should be \"product_id\":" + encodeURIComponent(element.id) + ", dropon should be \"cart\":" + dropon.id)}})</script>
<br/>
<img alt="Product2" id="product_id" src="./scriptaculous-js-1.6.4src/icon.png" /> &lt;-- drag this!
<script type="text/javascript">new Draggable("product_id", {revert:true})</script>
<h2>w/ hoverclass</h2>

<div id="carth" class="cart" style="text-align:center;height:50px;padding:10px;background-color:#fba">
### DROP HERE ###
</div>
<script type="text/javascript">Droppables.add("carth", {hoverclass:"hoverclass123",onDrop:function(element, dropon, event){alert("w/ hoverclass: should be \"product_id\":" + encodeURIComponent(element.id) + ", dropon should be \"carth\":" + dropon.id)}})</script>

</body>
</html>


<A href="http://www.wbex.ru/Code/JavaScriptDownload/scriptaculous-js-1.6.4.zip">scriptaculous-js-1.6.4.zip( 139 k)</a>


Ghost effect for dragging

<!-- Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>script.aculo.us Drag and drop functional test file</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <script src="./scriptaculous-js-1.6.4src/prototype.js" type="text/javascript"></script>
  <script src="./scriptaculous-js-1.6.4src/scriptaculous.js" type="text/javascript"></script>
  <script src="./scriptaculous-js-1.6.4src/unittest.js" type="text/javascript"></script>
</head>
<body style="background-color:#eee;">
<div style="position:relative;margin-left:100px;top:40px;background-color:white;">
(inside position:relative container)
<h1>script.aculo.us Drag and drop functional test file</h1>
<h2>Draggables/Droppables</h2>
<div id="absolute_positioned_element" class="box1" style="width:150px;height:150px;background:#bbf;">
  <b>Ghosting effect</b>
  <input type="text" value="blah"/>
  <div id="hurradiegams">test!</div>
  <br/>
</div>
<a href="#" onclick="alert($("hurradiegams").innerHTML); return false;">alert contents of test div</a>
<div id="absolute_positioned_element2" class="box1" style="width:150px;height:150px;background:#bbf;">
  <span id="handle1">Ghost effect</span><br/>
</div>
<script type="text/javascript" language="javascript" charset="utf-8">
  Position.includeScrollOffsets = true;
  new Draggable("absolute_positioned_element",{ghosting: true});
  new Draggable("absolute_positioned_element2",{ghosting: true, revert:true});
</script>
</div>
</body>
</html>


<A href="http://www.wbex.ru/Code/JavaScriptDownload/scriptaculous-js-1.6.4.zip">scriptaculous-js-1.6.4.zip( 139 k)</a>


Hide component during dragging

<!-- 
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>script.aculo.us Drag and drop functional test file</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <script src="./scriptaculous-js-1.6.4src/prototype.js" type="text/javascript"></script>
  <script src="./scriptaculous-js-1.6.4src/scriptaculous.js" type="text/javascript"></script>
  <script src="./scriptaculous-js-1.6.4src/unittest.js" type="text/javascript"></script>
  <style type="text/css" media="screen">
    #thelist li { background: green; margin:5px; padding: 30px; }
    #thelist2 li { background: #ffb; margin:2px; padding: 2px; }
    #revertbox2 { position:absolute;top:40px;left:50px;z-index:1000;width:150px;height:150px;background:#bbf; }
  </style>
</head>
<body>
<h1>script.aculo.us Drag and drop functional test file</h1>
<h2>Draggables/Droppables</h2>
<a href="#" onclick="alert($H(Sortable.sortables).inspect());return false">inspect sortables</a>
<div id="revertbox1" class="box1" style="opacity:0.5;z-index:1000;width:150px;height:150px;background:#bfb;">
  <span class="handle1">drag here</span><br/>
  <input type="checkbox" id="shouldrevert1"/> Revert?
</div>
<div id="revertbox2" class="box">
  <span id="handle2">drag here</span><br/>
  <input type="checkbox" id="shouldrevert2"/> Revert?
</div>
<div id="xxxx">testtest</div>
<script type="text/javascript" language="javascript" charset="utf-8">
  new Draggable("revertbox1",{scroll:window,zindex:-5,handle:"handle1",revert:function(element){return ($("shouldrevert1").checked)}});
  new Draggable("revertbox2",{scroll:window,handle:"handle2",revert:function(element){return ($("shouldrevert2").checked)}});
  Droppables.add("xxxx",{accept:["box1","box2"],onDrop:function(){alert("drop!")}});
</script>


<ul id="thelist" style="padding: 10px; position: absolute; top:20px; left:200px;z-index:1000;">
<li id="thelist_4">Hey there! I"m absolutely positioned</li>
<li id="thelist_1">one<br/><form id="form1"><input type="checkbox" onclick="this.checked = !this.checked" value="x" name="x" id="xyz"/><input type="text" id="xxx"></input></form></li>
<li id="thelist_2">two<br/><form id="form2"><input type="text" id="xyx"></input></form></li>
<li id="thelist_3">three<br/><form id="form3"><input type="text" id="xu3"></input></form></li>
</ul>
</body>
</html>


<A href="http://www.wbex.ru/Code/JavaScriptDownload/scriptaculous-js-1.6.4.zip">scriptaculous-js-1.6.4.zip( 139 k)</a>


Using drag and move to force the right-hand pane to scroll

<!-- 
Copyright (c) 2005 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<!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></title>
<script src="./scriptaculous-js-1.6.4src/prototype.js" type="text/javascript"></script>
<script src="./scriptaculous-js-1.6.4src/scriptaculous.js" type="text/javascript"></script>
<script type="text/javascript">
Position.includeScrollOffsets = true;
Draggables.clear = function (event) {
  while (Draggables.drags.length) {
    var d = Draggables.drags.pop();
    var e = d.element;
    d.stopScrolling();
    d.destroy();
    d.element = null;
    if (e.parentNode) {e.parentNode.removeChild(e)}; 
  }
}
function cleanup() { //try to remove circular references
  lis = document.getElementsByTagName("li");
  for (i = 0; i < lis.length; i++) {
    if (lis[i].longListItem) {lis[i].longListItem.destroy();}
    else if (lis[i].container) {lis[i].container.destroy();}
  }
  Draggables.clear();
}
window.onload = function() {
  var li = $("masterList").getElementsByTagName("LI");
  for (var i = 0; i < li.length; i++) {
    //var d = new LongListItem(li[i]);
    //li[i].onmousedown = d.onMouseDown.bindAsEventListener(d);
    var d = new Draggable(li[i], 
      {revert: true,
       ghosting: false,
       scroll: "rightContainers"
      });
  }
  
  var divs = $("rightContainers").getElementsByTagName("div");
  for (i = 0; i < divs.length; i++) {
    if (divs[i].className && Element.hasClassName(divs[i], "container")) {
      Droppables.add(divs[i].id, {hoverclass: "hover", scrollingParent: "rightContainers"});
    }
  }
  Event.observe(window, "unload", cleanup, false);
}
</script>
<style type="text/css">
html, body {
  margin:0; padding: 0;
  height: 100% !important;
}
body {
  position:relative;
  color: black;
  background-color: white;
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: small;
}
h1 {font-size:115%;}
h2 {font-size: 110%;}
h3 {font-size: 105%;}
div, p, li, td {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: small;
}
p {margin: 0 0 .7em 0; padding:0;}
ul {
  position:relative;
  list-style: none;
  margin:0; padding:0;
  overflow: visible;
}
li {position:relative;}
.instructions {font-style:italic;}
#leftDiv {
  position: absolute;
  top: 0;  left: 0;   bottom: 0;
  width: 30%;
  margin: 0; padding: 7px;
  border-right: 2px solid #bb9;
  background-color: #eed;
}
#leftDiv li, #rightContainers div.container li  {
  margin: 3px 0; padding: 3px 3em 3px 10px;
  border: 2px solid #456;
  background-color: #cde;
  cursor: move;
}
#rightContainers {
  padding: .5em;
  position: absolute;
  top: 0; bottom: 0; right: 0; left: 35%;
  overflow:auto;
}
#rightContainers div.container{
  background-color: #bb9;
  margin: 0 0 40px 0; padding: 0 0 1px 0;
  border: 2px solid #775;
}
#rightContainers div.container h2{
  margin:0; padding: 2px 1em 0 1em;
  text-align:center;
}
#rightContainers div.container ul {
  margin: 5px; padding: 0 3px;
  background-color: white;
  border: 1px solid black;
}
#rightContainers div.container ul.empty {
  padding: 3px 0;
}
#rightContainers div.hover {
  background-color: #eed;
}
</style>
<!--[if IE]><style type="text/css">
#leftDiv {
  height: expression((document.body.clientHeight - 44) + "px");
}
#leftDiv ul{width:93%;}
#leftDiv li div.count {
  right:4px;
  top:4px;
}
#rightContainers li a.remove {
  display:block;
  float:none;
  position:absolute;
  top: 4px;
  right: 1.6em;  
  margin:0; padding:0 .2em;
}
</style><![endif]-->
</head>
<body>
<div id="leftDiv" class="">
<form id="frmContinue" action="#" method="post">
<p class="instructions">Shrink your window until the right-hand pane is scrollable.</p>
<p class="instructions">Drag from the list on left to groups on the right, force the right-hand pane to scroll.</p>
<input name="data" type="hidden" value=" ">
</form>
<ul id="masterList">
<li id="drag1">One</li>
<li id="drag2">Two</li>
<li id="drag3">Three</li>
<li id="drag4">Four</li>
<li id="drag5">Five</li>
<li id="drag6">Six</li>
<li id="drag7">Seven</li>
<li id="drag8">Eight</li>
</ul>
</div>
<div id="rightContainers" class="">
</form>
<div id="grp1" class="container">
  <h2><span id="grp1_name">Group 1</span></h2>
  <ul id="grp1ul" class="empty"></ul>
</div>
<div id="grp2" class="container">
  <h2><span id="grp2_name">Group 2</span></h2>
  <ul id="grp2ul" class="empty"></ul>
</div>
<div id="grp3" class="container">
  <h2><span id="grp3_name">Group 3</span></h2>
  <ul id="grp3ul" class="empty"></ul>
</div>
<div id="grp4" class="container">
  <h2><span id="grp4_name">Group 4</span></h2>
  <ul id="grp4ul" class="empty"></ul>
</div>
<div id="grp5" class="container">
  <h2><span id="grp5_name">Group 5</span></h2>
  <ul id="grp5ul" class="empty"></ul>
</div>
<div id="grp6" class="container">
  <h2><span id="grp6_name">Group 6</span></h2>
  <ul id="grp6ul" class="empty"></ul>
</div>
<div id="grp7" class="container">
  <h2><span id="grp7_name">Group 7</span></h2>
  <ul id="grp7ul" class="empty"></ul>
</div>
<div id="grp8" class="container">
  <h2><span id="grp8_name">Group 8</span></h2>
  <ul id="grp8ul" class="empty"></ul>
</div>
<div id="grp9" class="container">
  <h2><span id="grp9_name">Group 9</span></h2>
  <ul id="grp9ul" class="empty"></ul>
</div>
</div>
</body>
</html>


<A href="http://www.wbex.ru/Code/JavaScriptDownload/scriptaculous-js-1.6.4.zip">scriptaculous-js-1.6.4.zip( 139 k)</a>