scroll bar

 1  $(document).ready(function () {
 2         var length = $('.img_check_outer img').length;
 3         alert(length);
 4         var showImgCount=2;
 5         if(length > showImgCount){
 6             $('.img_check_outer').css('height',306*Math.ceil(length/showImgCount));
 7         };
 8         var nCheck = 0;
 9         $('.lit_btn_top').click(function () {
10             nCheck--;
11             if (nCheck < 0) {
12                 nCheck = 0;
13             }
14             $('.img_check_outer').stop().animate({ 'top': -306 * nCheck }, 400);
15         });
16 
17         $('.lit_btn_down').click(function () {
18             nCheck++;
19             if (nCheck > Math.ceil(length / showImgCount) - 1) {
20                 nCheck = Math.ceil(length / showImgCount) - 1;
21             }
22                 $('.img_check_outer').stop().animate({ 'top': -306 * nCheck }, 400);
23         });
24 
25     })


 

posted @ 2013-11-06 15:17  tiger5  阅读(79)  评论(0)    收藏  举报