7b15984b47ad75b75846817d6a57d035e68118cd.svn-base 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  5. <title></title>
  6. <!--框架必需start-->
  7. <script type="text/javascript" src="../../libs/js/jquery.js"></script>
  8. <script type="text/javascript" src="../../libs/js/language/cn.js"></script>
  9. <script type="text/javascript" src="../../libs/js/framework.js"></script>
  10. <link href="../../libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  11. <link rel="stylesheet" type="text/css" id="skin" prePath="../../"/>
  12. <link rel="stylesheet" type="text/css" id="customSkin"/>
  13. <!--框架必需end-->
  14. <!--数字分页start-->
  15. <script type="text/javascript" src="../../libs/js/nav/pageNumber.js"></script>
  16. <!--数字分页end-->
  17. </head>
  18. <body>
  19. <div class="box1" panelWidth="900">
  20. <fieldset>
  21. <legend>1、默认设置</legend>
  22. <div class="pageNumber" total="200" id="page-1"></div>
  23. </fieldset>
  24. <div class="height_15"></div>
  25. <fieldset>
  26. <legend>2、自定义属性1(复杂)</legend>
  27. <div class="pageNumber" total="200" pageSize="5" centerPageNum="10" edgePageNum="4" page="2" prevText="向前翻页" nextText="向后翻页" ></div>
  28. </fieldset>
  29. <div class="height_15"></div>
  30. <fieldset>
  31. <legend>3、自定义属性2(简洁)</legend>
  32. <div class="pageNumber" total="200" pageSize="10" centerPageNum="2" edgePageNum="0" prevText="前" nextText="后" ></div>
  33. </fieldset>
  34. <div class="height_15"></div>
  35. <fieldset>
  36. <legend>4、含下拉框</legend>
  37. <div class="pageNumber" total="200" showSelect="true" id="page-4"></div>
  38. </fieldset>
  39. <div class="height_15"></div>
  40. <fieldset>
  41. <legend>5、自定义下拉框数据和展开方向</legend>
  42. <div class="pageNumber" total="200"" pageSize="50" showSelect="true" selectDirection="bottom" selectData='{"list":[{"key":20,"value":20},{"key":50,"value":50},{"key":100,"value":100}]}'></div>
  43. </fieldset>
  44. <div class="height_15"></div>
  45. <fieldset>
  46. <legend>6、含跳转框</legend>
  47. <div class="pageNumber" total="200" showInput="true" id="page-6"></div>
  48. </fieldset>
  49. <div class="height_15"></div>
  50. <fieldset>
  51. <legend>7、综合布局</legend>
  52. <div style="height:35px;">
  53. <div class="float_left padding5">左侧要放置的内容。如没有可去掉。</div>
  54. <div class="float_right padding5">
  55. <div class="pageNumber" total="200" showSelect="true" showInput="true" id="page-7"></div>
  56. </div>
  57. <div class="clear"></div>
  58. </div>
  59. </fieldset>
  60. <fieldset>
  61. <legend>8、动态创建</legend>
  62. <button onclick="addPager()" id="testBtn">点击添加</button>
  63. <div id="pageContent" style="height:35px;"></div>
  64. </fieldset>
  65. <div class="height_15"></div>
  66. <fieldset>
  67. <legend>9、动态改变属性</legend>
  68. <div class="pageNumber" total="200" id="page-9"></div>
  69. <button onclick="changePager()">改变总条数</button>
  70. </fieldset>
  71. <div class="height_15"></div>
  72. </div>
  73. <script>
  74. $(function(){
  75. $("#page-1").bind("pageChange",function(e,index){
  76. alert(index)
  77. })
  78. $("#page-4").bind("sizeChange",function(e,num){
  79. alert(num)
  80. })
  81. $("#page-6").bind("pageChange",function(e,index){
  82. alert(index)
  83. })
  84. $("#page-7").bind("pageChange",function(e,index){
  85. alert("触发分页事件,当前页:"+(index+1))
  86. })
  87. $("#page-7").bind("sizeChange",function(e,num){
  88. alert("触发条数改变事件,每页条数:"+num)
  89. })
  90. })
  91. function addPager(){
  92. var $pager=$('<div class="pageNumber" total="200" showSelect="true" showInput="true"></div>');
  93. $pager.attr("total",300);
  94. var $pagerCon = $('<div class="float_left padding5">左侧要放置的内容。如没有可去掉。</div><div class="float_right padding5"></div><div class="clear"></div>');
  95. $pagerCon.eq(1).append($pager);
  96. $("#pageContent").append($pagerCon);
  97. $pager.render();
  98. $pager.bind("pageChange",function(e,index){
  99. alert(index)
  100. })
  101. $pager.bind("sizeChange",function(e,num){
  102. alert(num)
  103. })
  104. }
  105. function changePager(){
  106. $("#page-9").attr("total",300);
  107. $("#page-9").render();
  108. }
  109. </script>
  110. </body>
  111. </html>