富贵资源网 Design By www.hznty.com
复制代码 代码如下:
<script src="/UploadFiles/2021-04-02/jquery-1.4.1.js">   <script type="text/javascript">
       var pageindex = 1;
       var pagesize = 2;
       $(function () {
           previous();
       })
       function previous() {
           if (pageindex < 1 || pageindex == 1) {
               pageindex = 1;
               $("#imgdiv img:lt(" + pagesize + ")").show();
               $("#imgdiv img").not($("#imgdiv img:lt(" + pagesize + ")")).hide();
           }
           else {
               pageindex--;
               if (pageindex != 1) {
                   $("#imgdiv img:gt(" + ((pageindex - 1) * pagesize - 1) + "):lt(" + pagesize + ")").show();
                   $("#imgdiv img").not($("#imgdiv img:gt(" + ((pageindex - 1) * pagesize - 1) + "):lt(" + pagesize + ")")).hide();
               }
               if (pageindex == 1) {
                   $("#imgdiv img:lt(" + pagesize + ")").show();
                   $("#imgdiv img").not($("#imgdiv img:lt(" + pagesize + ")")).hide();
               }
           }
       }
       function next() {
           var p = $("#imgdiv img").length / pagesize;

           var pagecount = parseInt(Math.ceil(p));

           if (pageindex + 1 > pagecount) {
               pageindex = pagecount;
           } else {
               pageindex++;
           }
           $("#imgdiv img:gt(" + ((pageindex - 1) * pagesize - 1) + "):lt(" + pagesize + ")").show();
           $("#imgdiv img").not($("#imgdiv img:gt(" + ((pageindex - 1) * pagesize - 1) + "):lt(" + pagesize + ")")).hide();
       }
   </script>
<div>
       <a href="javascript:previous()">上一页</a>
       <div id="imgdiv">
           <img src="/UploadFiles/2021-04-02/001.jpg">           <img src="/images/002.jpg">           <img src="/UploadFiles/2021-04-02/003.jpg">           <img src="/images/004.jpg">           <img src="/UploadFiles/2021-04-02/005.jpg">       </div>
       <a href="javascript:next()">下一页</a>
   </div>
富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com