轮播图 放大镜

轮播图
 $(".points-list>li").eq(current).addClass("active").siblings().removeClass("active");
当前的图片加上active类名,其他图片li移除这个类名 
 
定时器
var timer=setInterval(()=>{
      next();
 },3000);
 
siblings元素的同胞
closest找到父节点
 
  if(left>200){
            left=200; 大框400 小黑框占200,所以应距离200
   }
 
小图是400*400 大图800*800 要等比的话就要大两倍 反方向移动 所以是负数
  $(".big_box img").css({
            left:-2*left+"px",
            top:-2*top+"px"
        }
 
posted @ 2021-11-15 17:55  熊熊日记  阅读(53)  评论(0)    收藏  举报