98a50bfb8ec35c654d10b39b2a9f4a29b8b9e347.svn-base 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5. <title>Dojo Slider Widget Demo</title>
  6. <script type="text/javascript" src="../../../dojo/dojo.js"
  7. djConfig="isDebug: true, parseOnLoad: true, extraLocale: ['de-de', 'en-us']"></script>
  8. <script type="text/javascript" src="../_testCommon.js"></script>
  9. <script type="text/javascript">
  10. dojo.require("dijit.form.Slider");
  11. dojo.require("dijit.form.Button");
  12. dojo.require("dojo.parser"); // scan page for widgets
  13. dojo.addOnLoad(function(){
  14. dijit.byId("sliderH2").setDisabled(true);
  15. });
  16. </script>
  17. <style type="text/css">
  18. @import "../../../dojo/resources/dojo.css";
  19. @import "../css/dijitTests.css";
  20. #slider2 .dijitButtonNode {
  21. width:12px;
  22. height:12px;
  23. border: none;
  24. font-size:11px;
  25. padding:0px;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <h1 class="testTitle">Slider</h1>
  31. Also try using the arrow keys, buttons, or clicking on the progress bar to move the slider.
  32. <br>
  33. <br>initial value=10, min=0, max=100, pageIncrement=100, onChange event triggers input box value change immediately<br>
  34. <div dojoType="dijit.form.HorizontalSlider" name="horizontal1"
  35. onChange="dojo.byId('slider1input').value=dojo.number.format(arguments[0]/100,{places:0,pattern:'#%'});"
  36. value="20"
  37. maximum="100"
  38. minimum="0"
  39. pageIncrement="100"
  40. showButtons="false"
  41. intermediateChanges="true"
  42. style="width:50%; height: 20px;"
  43. id="slider1">
  44. <ol dojoType="dijit.form.HorizontalRuleLabels" container="topDecoration" style="height:1.2em;font-size:75%;color:gray;" count="6" numericMargin="1"></ol>
  45. <div dojoType="dijit.form.HorizontalRule" container="topDecoration" count=6 style="height:5px;"></div>
  46. <div dojoType="dijit.form.HorizontalRule" container="bottomDecoration" count=5 style="height:5px;"></div>
  47. <ol dojoType="dijit.form.HorizontalRuleLabels" container="bottomDecoration" style="height:1em;font-size:75%;color:gray;">
  48. <li>lowest</li>
  49. <li>normal</li>
  50. <li>highest</li>
  51. </ol>
  52. </div>
  53. Slider1 Value:<input readonly id="slider1input" size="4" value="20%">
  54. <br>
  55. <button id="disableButton" dojoType="dijit.form.Button" onClick="dijit.byId('slider1').setDisabled( true);dijit.byId('disableButton').setDisabled(true);dijit.byId('enableButton').setDisabled(false);">Disable previous slider</button>
  56. <button id="enableButton" dojoType="dijit.form.Button" onClick="dijit.byId('slider1').setDisabled(false);dijit.byId('disableButton').setDisabled(false);dijit.byId('enableButton').setDisabled( true);" disabled>Enable previous slider</button>
  57. <br>
  58. <br>initial value=10, min=0, max=100, onChange event triggers input box value change when you mouse up or tab away<br>
  59. <div dojoType="dijit.form.VerticalSlider" name="vertical1"
  60. onChange="dojo.byId('slider2input').value=arguments[0];"
  61. value="10"
  62. maximum="100"
  63. minimum="0"
  64. discreteValues="11"
  65. style="height:300px;"
  66. id="slider2">
  67. <ol dojoType="dijit.form.VerticalRuleLabels" container="leftDecoration" style="width:2em;color:gray;" labelStyle="right:0px;">
  68. <li>0</li>
  69. <li>100</li>
  70. </ol>
  71. <div dojoType="dijit.form.VerticalRule" container="leftDecoration" count=11 style="width:5px;" ruleStyle="border-color:gray;"></div>
  72. <div dojoType="dijit.form.VerticalRule" container="rightDecoration" count=11 style="width:5px;" ruleStyle="border-color:gray;"></div>
  73. <ol dojoType="dijit.form.VerticalRuleLabels" container="rightDecoration" style="width:2em;color:gray;" count="6" numericMargin="1" maximum="100" constraints={pattern:'#'}></ol>
  74. </div>
  75. Slider2 Value:<input readonly id="slider2input" size="3" value="10">
  76. <h1>Fancy HTML labels:</h1>
  77. <div dojoType="dijit.form.HorizontalSlider" name="horizontal2"
  78. onChange="dojo.byId('slider9input').value=arguments[0];"
  79. minimum="1"
  80. value="3"
  81. maximum="3"
  82. discreteValues="3"
  83. showButtons="false"
  84. intermediateChanges="true"
  85. style="width:300px; height: 40px;"
  86. id="slider3">
  87. <div dojoType="dijit.form.HorizontalRule" container="bottomDecoration" count=3 style="height:5px;"></div>
  88. <ol dojoType="dijit.form.HorizontalRuleLabels" container="bottomDecoration"
  89. style="height:1em;font-size:75%;color:gray;">
  90. <li><img width=10 height=10 src="../images/note.gif"><br><span style="font-size: small">small</span></li>
  91. <li><img width=15 height=15 src="../images/note.gif"><br><span style="font-size: medium">medium</span></li>
  92. <li><img width=20 height=20 src="../images/note.gif"><br><span style="font-size: large">large</span></li>
  93. </ol>
  94. </div>
  95. <input readonly id="slider9input" value="" size="">
  96. <p></p><h1>Standalone ruler example:</h1><p></p>
  97. <div style="width:2in;border-top:1px solid black;">
  98. <div dojoType="dijit.form.HorizontalRule" count=17 style="height:.4em;"></div>
  99. <div dojoType="dijit.form.HorizontalRule" count=9 style="height:.4em;"></div>
  100. <div dojoType="dijit.form.HorizontalRule" count=5 style="height:.4em;"></div>
  101. <div dojoType="dijit.form.HorizontalRule" count=3 style="height:.4em;"></div>
  102. <ol dojoType="dijit.form.HorizontalRuleLabels" labelStyle="font-style:monospace;font-size:.7em;margin:-1em 0px 0px -.35em;">
  103. <li></li>
  104. <li>1</li>
  105. <li>2</li>
  106. </ol>
  107. </div>
  108. <h1>horizontal, with buttons, disabled (to show styling):</h1>
  109. <div dojoType="dijit.form.HorizontalSlider" name="horizontalH2"
  110. onChange="dojo.byId('slider1input').value=arguments[0];"
  111. value="10"
  112. maximum="100"
  113. minimum="0"
  114. disabled="true"
  115. showButtons="true"
  116. intermediateChanges="true"
  117. style="width:50%; height: 20px;"
  118. id="sliderH2">
  119. <ol dojoType="dijit.form.HorizontalRuleLabels" container="topDecoration" style="height:1.2em;font-size:75%;color:gray;" count="7" constraints="{pattern:'#.00%'}"></ol>
  120. <div dojoType="dijit.form.HorizontalRule" container="topDecoration" count=7 style="height:5px;"></div>
  121. <div dojoType="dijit.form.HorizontalRule" container="bottomDecoration" count=5 style="height:5px;"></div>
  122. <ol dojoType="dijit.form.HorizontalRuleLabels" container="bottomDecoration" style="height:1em;font-size:75%;color:gray;">
  123. <li>lowest</li>
  124. <li>normal</li>
  125. <li>highest</li>
  126. </ol>
  127. </div>
  128. </body>
  129. </html>