285b3988801ab27cee2d46163c3dac442b188575.svn-base 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. %>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  9. <title>步进器</title>
  10. <!--框架必需start-->
  11. <script type="text/javascript" src="<%=path%>/libs/js/jquery.js"></script>
  12. <script type="text/javascript" src="<%=path%>/libs/js/language/cn.js"></script>
  13. <script type="text/javascript" src="<%=path%>/libs/js/framework.js"></script>
  14. <link href="<%=path%>/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  15. <link rel="stylesheet" type="text/css" id="skin" prePath="<%=path%>/"/>
  16. <link rel="stylesheet" type="text/css" id="customSkin"/>
  17. <!--框架必需end-->
  18. <!-- 数字步进器start -->
  19. <script type="text/javascript" src="<%=path%>/libs/js/form/stepper.js"></script>
  20. <!-- 数字步进器end -->
  21. </head>
  22. <body>
  23. <div class="box1" panelWidth="800">
  24. <fieldset>
  25. <legend>1、基本用法</legend>
  26. <input id="step1" type="text" class="stepper" value="0"/>
  27. <input type="button" value="获取值" onclick="getValue()"/>
  28. </fieldset>
  29. <div class="height_15"></div>
  30. <fieldset>
  31. <legend>2、自定义宽度</legend>
  32. <input type="text" class="stepper" style="width:50px;" value="100"/>
  33. </fieldset>
  34. <div class="height_15"></div>
  35. <fieldset>
  36. <legend>3、自定义最小值、最大值和步长</legend>
  37. <input type="text" class="stepper" min="5" max="10" value="5" step="0.5"/>
  38. </fieldset>
  39. <div class="height_15"></div>
  40. <fieldset>
  41. <legend>4、禁用/启用</legend>
  42. <input id="step4" type="text" class="stepper" value="0" disabled="true"/>
  43. <input type="button" value="启用" onclick="enableSelect()" style="width:105px;"/>
  44. <input type="button" value="禁用" onclick="disableSelect()" style="width:105px;"/>
  45. </fieldset>
  46. <div class="height_15"></div>
  47. <fieldset>
  48. <legend>5、动态添加步进器</legend>
  49. <button onclick="addStepper()" id="testBtn">点击添加</button><br /><br />
  50. </fieldset>
  51. <div class="height_15"></div>
  52. <fieldset>
  53. <legend>6、动态改变值</legend>
  54. <input id="step6" type="text" class="stepper" value="0"/>
  55. <input type="button" value="改变值为50" onclick="changeValue()"/>
  56. </fieldset>
  57. <div class="height_15"></div>
  58. <fieldset>
  59. <legend>7、构建时间选择器</legend>
  60. <table>
  61. <tr>
  62. <td>请选择时间:</td>
  63. <td><input type="text" class="stepper" style="width:40px;" min="0" max="24" value="19" step="1" id="hour"/></td>
  64. <td>时</td>
  65. <td><input type="text" class="stepper" style="width:40px;" min="0" max="60" value="51" step="1" id="minite"/></td>
  66. <td>分</td>
  67. <td><input type="button" value="获取时间" onclick="getTimeValue()"/></td>
  68. </tr>
  69. </table>
  70. </fieldset>
  71. <div class="height_15"></div>
  72. <fieldset>
  73. <legend>8、change事件</legend>
  74. <input id="step8" type="text" class="stepper" value="0"/>
  75. </fieldset>
  76. </div>
  77. <script type="text/javascript">
  78. function initComplete(){
  79. $("#step8").bind("change",function(e,data){
  80. top.Dialog.alert(data.toString())
  81. })
  82. }
  83. //获取步进器的值
  84. function getValue(){
  85. top.Dialog.alert($('#step1').val());
  86. }
  87. //设为不可用
  88. function disableSelect(){
  89. $("#step4").attr("disabled",true);
  90. }
  91. //设为可用
  92. function enableSelect(){
  93. $("#step4").attr("disabled",false);
  94. }
  95. //动态添加步进器
  96. function addStepper(){
  97. var $stepper = $('<input id="step1" type="text" class="stepper" min="5" max="10" value="5" step="0.5"/>');
  98. $("#testBtn").after($stepper);
  99. $stepper.render();
  100. }
  101. //改变值
  102. function changeValue(){
  103. $("#step6").val(50);
  104. }
  105. function getTimeValue(){
  106. top.Dialog.alert("所选时间:"+$('#hour').val()+":"+$('#minite').val());
  107. }
  108. </script>
  109. </body>
  110. </html>