zoukankan      html  css  js  c++  java
  • 简单的图片翻页

     1 function animatePic(){
     2                 var box=$(".list-img");
     3                 var item=box.find(".item-img");
     4                 var left;
     5                 var len=item.length;
     6                 var _w=item.width();
     7                 var w=_w*len;
     8                 var num=2;
     9                 $(".list-img").width(_w*len);
    10                 $(".next").click(function(){
    11                     left=box.position().left;
    12                     if(left<=(w-_w*num)*-1) return false;
    13                     if(!box.is(":animated")){
    14                         box.animate({left:"-="+_w},500);
    15                     }
    16                 });
    17                 $(".prev").click(function(){
    18                     left=box.position().left;
    19                     if(left>=0) return false;
    20                     if(!box.is(":animated")){
    21                         box.animate({left:"+="+_w},500);
    22                     }
    23                 });
    24                 $(".box-img .item-img").click(function(){
    25                     var src = $(this).find("img").attr("src");
    26                     $("img.left-img").attr("src", src);
    27                 });
    28             }
  • 相关阅读:
    元类、orm
    MySQL进阶
    python操作mysql
    tf矩阵基础
    tensorflow安装时遇到的问题
    Loading
    弹球落地
    3dMenu
    响应式布局:flex
    渐变linear-gradient
  • 原文地址:https://www.cnblogs.com/lihui1030/p/4047551.html
Copyright © 2011-2022 走看看