| 1 | |
|---|
| 2 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
|---|
| 3 | <html> |
|---|
| 4 | <head> |
|---|
| 5 | <title>Text effects tests</title> |
|---|
| 6 | <script type="text/javascript" src="../../lib/prototype.js"></script> |
|---|
| 7 | <script type="text/javascript" src="../../src/scriptaculous.js"></script> |
|---|
| 8 | </head> |
|---|
| 9 | <body> |
|---|
| 10 | |
|---|
| 11 | <h1>Sliders</h1> |
|---|
| 12 | |
|---|
| 13 | <h2>Standard horizontal slider</h2> |
|---|
| 14 | |
|---|
| 15 | <div id="track1" style="width:200px;background-color:#aaa;height:5px;"> |
|---|
| 16 | <div id="handle1" style="width:5px;height:10px;background-color:#f00;"> </div> |
|---|
| 17 | </div> |
|---|
| 18 | |
|---|
| 19 | <p id="debug1"> </p> |
|---|
| 20 | |
|---|
| 21 | <h2>Vertical slider</h2> |
|---|
| 22 | |
|---|
| 23 | <div id="track2" style="height:100px;background-color:#aaa;width:5px;"> |
|---|
| 24 | <div id="handle2" style="width:10px;height:5px;background-color:#f00;"> </div> |
|---|
| 25 | </div> |
|---|
| 26 | |
|---|
| 27 | <p id="debug2"> </p> |
|---|
| 28 | |
|---|
| 29 | <h2>Slider with predefined values [2,4,6,8] and a non-default range [2,15]</h2> |
|---|
| 30 | |
|---|
| 31 | <div id="track3" style="width:200px;background-color:#aaa;height:5px;"> |
|---|
| 32 | <div id="handle3" style="width:5px;height:10px;background-color:#f00;"> </div> |
|---|
| 33 | </div> |
|---|
| 34 | |
|---|
| 35 | <p id="debug3"> </p> |
|---|
| 36 | |
|---|
| 37 | <h2>Slider with multiple handles</h2> |
|---|
| 38 | |
|---|
| 39 | <div id="track4" style="width:200px;background-color:#aaa;height:5px;position:relative;"> |
|---|
| 40 | <div id="handle4-1" style="position:absolute;top:0;left:0;width:5px;height:10px;background-color:#f00;"> </div> |
|---|
| 41 | <div id="handle4-2" style="position:absolute;top:0;left:0;width:5px;height:10px;background-color:#0f0;"> </div> |
|---|
| 42 | <div id="handle4-3" style="position:absolute;top:0;left:0;width:5px;height:10px;background-color:#00f;"> </div> |
|---|
| 43 | </div> |
|---|
| 44 | |
|---|
| 45 | <p id="debug4"> </p> |
|---|
| 46 | |
|---|
| 47 | <h2>Slider with multiple handles and predefined values</h2> |
|---|
| 48 | |
|---|
| 49 | <div id="track5" style="width:200px;background-color:#aaa;height:5px;position:relative;"> |
|---|
| 50 | <div id="handle5-1" style="opacity:0.5;position:absolute;top:0;left:0;width:5px;height:10px;background-color:#f00;"> </div> |
|---|
| 51 | <div id="handle5-2" style="opacity:0.5;position:absolute;top:0;left:0;width:5px;height:10px;background-color:#0f0;"> </div> |
|---|
| 52 | <div id="handle5-3" style="opacity:0.5;position:absolute;top:0;left:0;width:5px;height:10px;background-color:#00f;"> </div> |
|---|
| 53 | </div> |
|---|
| 54 | |
|---|
| 55 | <p id="debug5"> </p> |
|---|
| 56 | |
|---|
| 57 | <h2>Slider with multiple handles, external controls, handles are restricted (can't be moved prior/after adjacent handles)</h2> |
|---|
| 58 | |
|---|
| 59 | <div id="track6" style="width:200px;background-color:#aaa;height:5px;position:relative;"> |
|---|
| 60 | <div id="handle6-1" style="position:absolute;top:0;left:0;width:5px;height:10px;background-color:#f00;"> </div> |
|---|
| 61 | <div id="handle6-2" style="position:absolute;top:0;left:0;width:5px;height:10px;background-color:#0f0;"> </div> |
|---|
| 62 | </div> |
|---|
| 63 | |
|---|
| 64 | <br/><br/> |
|---|
| 65 | <a href="#" onclick="slider6.setValueBy(-0.1);return false;"><--</a> |
|---|
| 66 | <a href="#" onclick="slider6.setValueBy(0.1);return false;">--></a> |
|---|
| 67 | |
|---|
| 68 | <p id="debug6"> </p> |
|---|
| 69 | |
|---|
| 70 | <h2>Fun with spans</h2> |
|---|
| 71 | |
|---|
| 72 | <style> |
|---|
| 73 | #track7 div.handle { |
|---|
| 74 | background-color:#aaa; |
|---|
| 75 | color:#444; |
|---|
| 76 | top:0; |
|---|
| 77 | left:0; |
|---|
| 78 | position:absolute; |
|---|
| 79 | z-index:2; |
|---|
| 80 | height:100px; |
|---|
| 81 | font-size:20px; |
|---|
| 82 | } |
|---|
| 83 | #track7 div.handle.selected { |
|---|
| 84 | background-color:#444; |
|---|
| 85 | color:#fff; |
|---|
| 86 | } |
|---|
| 87 | </style> |
|---|
| 88 | |
|---|
| 89 | <div id="track7" style="width:300px;background-color:#cbf;height:50px;position:relative;z-index:0;"> |
|---|
| 90 | <div id="handle7-1" class="handle">1</div> |
|---|
| 91 | <div id="handle7-2" class="handle">2</div> |
|---|
| 92 | <div id="handle7-3" class="handle">3</div> |
|---|
| 93 | |
|---|
| 94 | <div id="span7-1" style="top:0;left:0;position:absolute;background-color:#000;height:50px;z-index:1;"> </div> |
|---|
| 95 | <div id="span7-2" style="top:0;left:0;position:absolute;background-color:#444;height:50px;z-index:1;"> </div> |
|---|
| 96 | |
|---|
| 97 | <div id="span7-start" style="top:0;left:0;position:absolute;background-color:#f00;height:50px;z-index:1;"> </div> |
|---|
| 98 | <div id="span7-end" style="top:0;left:0;position:absolute;background-color:#00f;height:50px;z-index:1;"> </div> |
|---|
| 99 | </div> |
|---|
| 100 | |
|---|
| 101 | <br/><br/><br/><br/> |
|---|
| 102 | |
|---|
| 103 | <h2>Slider with span and [1,10] range (test for #3731)</h2> |
|---|
| 104 | |
|---|
| 105 | <div id="zoom-track" style="width:300px;background-color:#aaa;height:20px;position:relative;z-index:0;"> |
|---|
| 106 | <div id="zoom-handle-1" style="position:absolute;background-color:#f00;height:20px;z-index:2">!</div> |
|---|
| 107 | <div id="zoom-handle-2" style="position:absolute;background-color:#0f0;height:20px;z-index:2">!</div> |
|---|
| 108 | <div id="zoom-track-selected" style="position:absolute;background-color:#00f;height:20px;z-index:1"> </div> |
|---|
| 109 | </div> |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | <!-- FIXME: add more demos here --> |
|---|
| 113 | |
|---|
| 114 | <script type="text/javascript"> |
|---|
| 115 | // <![CDATA[ |
|---|
| 116 | new Control.Slider('handle1','track1',{ |
|---|
| 117 | sliderValue:0.5, |
|---|
| 118 | onSlide:function(v){$('debug1').innerHTML='slide: '+v}, |
|---|
| 119 | onChange:function(v){$('debug1').innerHTML='changed! '+v}}); |
|---|
| 120 | new Control.Slider('handle2','track2',{axis:'vertical', |
|---|
| 121 | onSlide:function(v){$('debug2').innerHTML='slide: '+v}, |
|---|
| 122 | onChange:function(v){$('debug2').innerHTML='changed! '+v}}); |
|---|
| 123 | new Control.Slider('handle3','track3',{values:[2,4,6,8],range:$R(2,15), |
|---|
| 124 | onSlide:function(v){$('debug3').innerHTML='slide: '+v}, |
|---|
| 125 | onChange:function(v){$('debug3').innerHTML='changed! '+v}}); |
|---|
| 126 | new Control.Slider(['handle4-1','handle4-2','handle4-3'],'track4',{ |
|---|
| 127 | onSlide:function(v){$('debug4').innerHTML='slide: '+v.inspect()}, |
|---|
| 128 | onChange:function(v){$('debug4').innerHTML='changed! '+v.inspect()}}); |
|---|
| 129 | new Control.Slider(['handle5-1','handle5-2','handle5-3'],'track5',{values:[0,0.2,0.4,0.6,0.8], |
|---|
| 130 | onSlide:function(v){$('debug5').innerHTML='slide: '+v.inspect()}, |
|---|
| 131 | onChange:function(v){$('debug5').innerHTML='changed! '+v.inspect()}}); |
|---|
| 132 | var slider6 = new Control.Slider(['handle6-1','handle6-2'],'track6',{ |
|---|
| 133 | sliderValue:[0.3, 0.8], |
|---|
| 134 | restricted:true, |
|---|
| 135 | onSlide:function(v){$('debug6').innerHTML='slide: '+v.inspect()}, |
|---|
| 136 | onChange:function(v){$('debug6').innerHTML='changed! '+v.inspect()}}); |
|---|
| 137 | new Control.Slider(['handle7-1','handle7-2','handle7-3'], 'track7', |
|---|
| 138 | { spans:['span7-1','span7-2'], |
|---|
| 139 | startSpan:'span7-start', |
|---|
| 140 | endSpan:'span7-end', |
|---|
| 141 | range:$R(0,300) }); |
|---|
| 142 | new Control.Slider( |
|---|
| 143 | ['zoom-handle-1','zoom-handle-2'],'zoom-track',{ |
|---|
| 144 | sliderValue:[1,10], range:$R(1,10), |
|---|
| 145 | values:[1,2,3,4,5,6,7,8,9,10], |
|---|
| 146 | restricted:true, |
|---|
| 147 | spans:['zoom-track-selected'] }); |
|---|
| 148 | // ]]> |
|---|
| 149 | </script> |
|---|
| 150 | |
|---|
| 151 | </body> |
|---|
| 152 | </html> |
|---|