| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
|---|
| 2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|---|
| 3 | |
|---|
| 4 | <html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 5 | <head> |
|---|
| 6 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
|---|
| 7 | <title>script.aculo.us functional test</title> |
|---|
| 8 | <script type="text/javascript" src="../../lib/prototype.js"></script> |
|---|
| 9 | <script type="text/javascript" src="../../src/effects.js"></script> |
|---|
| 10 | <script type="text/javascript" src="../../src/dragdrop.js"></script> |
|---|
| 11 | <script type="text/javascript"> |
|---|
| 12 | //<![CDATA[ |
|---|
| 13 | var myStartEffect = function(element) { |
|---|
| 14 | element._opacity = Element.getOpacity(element); |
|---|
| 15 | new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7}); |
|---|
| 16 | new Effect.Highlight(element, {}); |
|---|
| 17 | } |
|---|
| 18 | //]]> |
|---|
| 19 | </script> |
|---|
| 20 | <style type="text/css"> |
|---|
| 21 | /*<![CDATA[*/ |
|---|
| 22 | h1 {font-size: 1.2em; text-align:center;} |
|---|
| 23 | li { |
|---|
| 24 | margin: 5px auto; |
|---|
| 25 | padding: 2px; |
|---|
| 26 | width: 200px; |
|---|
| 27 | text-align:center; |
|---|
| 28 | list-style-type:none; |
|---|
| 29 | border: 2px solid #779; |
|---|
| 30 | background-color: #dde |
|---|
| 31 | } |
|---|
| 32 | div { |
|---|
| 33 | margin: 5px auto; |
|---|
| 34 | padding: 2px; |
|---|
| 35 | width: 300px; |
|---|
| 36 | text-align:center; |
|---|
| 37 | border: 2px solid #797; |
|---|
| 38 | background-color: #ded |
|---|
| 39 | } |
|---|
| 40 | /*]]>*/ |
|---|
| 41 | </style> |
|---|
| 42 | </head> |
|---|
| 43 | |
|---|
| 44 | <body> |
|---|
| 45 | <h1>No delay sortable</h1> |
|---|
| 46 | |
|---|
| 47 | <ul id="sort1"> |
|---|
| 48 | <li id="s1_1">one</li> |
|---|
| 49 | |
|---|
| 50 | <li id="s1_2">two</li> |
|---|
| 51 | |
|---|
| 52 | <li id="s1_3">three</li> |
|---|
| 53 | </ul> |
|---|
| 54 | |
|---|
| 55 | <h1>Delayed sortable (500 ms)</h1> |
|---|
| 56 | |
|---|
| 57 | <ul id="sort2"> |
|---|
| 58 | <li id="s2_1">one</li> |
|---|
| 59 | |
|---|
| 60 | <li id="s2_2">two</li> |
|---|
| 61 | |
|---|
| 62 | <li id="s2_3">three</li> |
|---|
| 63 | </ul> |
|---|
| 64 | |
|---|
| 65 | <h1>No delay draggable</h1> |
|---|
| 66 | |
|---|
| 67 | <div id="drag1"> |
|---|
| 68 | Lorem ipsum |
|---|
| 69 | </div> |
|---|
| 70 | |
|---|
| 71 | <h1>Delayed draggable (1000 ms)</h1> |
|---|
| 72 | |
|---|
| 73 | <div id="drag2"> |
|---|
| 74 | Lorem ipsum |
|---|
| 75 | </div> |
|---|
| 76 | |
|---|
| 77 | <script type="text/javascript" charset="utf-8"> |
|---|
| 78 | Sortable.create('sort1', {starteffect: myStartEffect}); |
|---|
| 79 | Sortable.create('sort2', {starteffect:myStartEffect, delay:500}); |
|---|
| 80 | new Draggable('drag1', {starteffect:myStartEffect}); |
|---|
| 81 | new Draggable('drag2', {starteffect:myStartEffect, delay:1000}); |
|---|
| 82 | </script> |
|---|
| 83 | </body> |
|---|
| 84 | </html> |
|---|