筆記--分頁樣式修改之後

 

  1. <div> 
  2. <et:dataview datasource="DbSrc1" pagesize="1"
  3.     <table> 
  4.         <tr> 
  5.             <td> 
  6.                 ID 
  7.             </td> 
  8.             <td> 
  9.                 NAME 
  10.             </td> 
  11.         </tr>         
  12.         <et:it> 
  13.         <tr> 
  14.             <td> 
  15.                 <et:datacolumn field="ID" /></td><td><et:datacolumn field="NAME" /> 
  16.             </td> 
  17.         </tr> 
  18.         </et:it> 
  19.         </table> 
  20.         <div align="right"
  21.             <table> 
  22.                 <tr> 
  23.                     <td><et:pager cssclass="the_pages" pagebuttoncount="8" showrecordcount="true" RecordCountFormat="共&nbsp;&nbsp;<span id='sum' style='color:Red'>{0}</span>&nbsp;&nbsp;頁&nbsp;&nbsp;"></et:pager></td> 
  24.                     <td> 
  25.                         <span class="num">&nbsp;&nbsp;到第</span> 
  26.                         <input type="text" id="toPage" value="1"  onkeypress='return changePage()' onmouseover='this.focus();' onfocus='this.select()'/> 
  27.                         <span class="num">&nbsp;頁</span> 
  28.                         <input type="button" class="goButtonCss" value="跳轉" onclick="GotoPage()"/> 
  29.                         <script type="text/javascript"
  30.                             var param_page="<et:echo source='page' parameter='page'></et:echo>"// 當前頁碼 
  31.                             if(param_page!=""
  32.                             { 
  33.                                 document.getElementById('toPage').value = param_page; 
  34.                             } 
  35.                             function GotoPage() 
  36.                             { 
  37.                                 var pg = document.getElementById('toPage').value; // 輸入框的值 
  38.                                 var r = pg.match(/^[0-9]*[1-9][0-9]*$/); // 與正整數匹配 
  39.                                 if (null == r) 
  40.                                 { 
  41.                                     alert('請輸入正整數');  
  42.                                     return false;  
  43.                                 } 
  44.                                 var maxPage = $("#sum").text().replace(/[^\x00-\xff]/g, ""); // 總頁數 
  45.                                 if (parseInt(pg) >parseInt(maxPage)) 
  46.                                 { 
  47.                                     alert('頁碼不得超過' + maxPage);  
  48.                                 } 
  49.                                 else 
  50.                                 { 
  51.                                     top.location.href = 'default.aspx?page=' + pg; 
  52.                                 } 
  53.                             } 
  54.                             function changePage() 
  55.                             { 
  56.                                 try 
  57.                                 { 
  58.                                     if (window.event.keyCode == 13) 
  59.                                     { 
  60.                                         GotoPage(); 
  61.                                         return false
  62.                                     } 
  63.                                 } catch (e) { }  
  64.                                 return true
  65.                             } 
  66.                         </script> 
  67.                     </td> 
  68.                 </tr> 
  69.             </table> 
  70.         </div> 
  71.         </et:dataview> 
  72. </div> 

 

  1. .the_pages{height:17px;font-family:arial,simSum;color:#FFA200;padding:10px 0
  2. .the_pages a{display:block;float:left;width:auto;white-space:nowrap;text-align:center;border:1px solid #A5A5A5;line-height:18px;margin:0 2px;padding:2px 8px
  3. .the_pages span{color:#FFA200;background:#fff;border-color:#666;padding:2px 8px
  4. .the_pages a.linknow{border:1px solid #A5A5A5;background:#164a84;color:#fff
  5. .the_pages a:hover{background:#FFA200;color:#fff;text-decoration:none
  6. .the_pages input{height:17px;overflow:hidden;font-size:12px;margin:0 4px 0 0;padding:2pxvertical-align:middle;} 
  7. .the_pages input.goButtonCss{width:43px;height:17px;padding:3px 9px 5px;background:#164A84;text-align:center;line-height:18px;color:#fff;font-weight:700;border:0
  8. .the_pages span.num{border:none;background:none;color:#000;padding:2px 2px 2px 8px
  9. #toPageheight:20pxwidth:20px;} 
  10. .the_pages .total{ color:#000;} /*共幾頁*/ 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章