//获取carsoul圆点数量 var num=$("#banner .item").length; var html=""; for( var i=0;i`; //console.log(i); } $("#banner").siblings(".carousel-indicators").html(html); //通知滚动 var sum=$(".total .total-con .total-left .total-list ul li").length-1; var timer=setInterval(function(){ var toop=parseInt($(".total .total-con .total-left .total-list ul").css("top")); toop-=50; if(toop <= -50*sum){ $(".total .total-con .total-left .total-list ul").css("top",toop); setTimeout(function(){ toop=0; $(".total .total-con .total-left .total-list ul").css("transition","0s"); $(".total .total-con .total-left .total-list ul").css("top",toop); },1000); }else{ $(".total .total-con .total-left .total-list ul").css("transition","0.8s"); $(".total .total-con .total-left .total-list ul").css("top",toop); } },2000); $(".total .total-con .total-left .total-list ul li a").mouseover( function(){ clearInterval(timer); timer=""; } ); $(".total .total-con .total-left .total-list ul li a").mouseout( function(){ timer=setInterval(function(){ var toop=parseInt($(".total .total-con .total-left .total-list ul").css("top")); toop-=50; if(toop <= -50*sum){ $(".total .total-con .total-left .total-list ul").css("top",toop); setTimeout(function(){ toop=0; $(".total .total-con .total-left .total-list ul").css("transition","0s"); $(".total .total-con .total-left .total-list ul").css("top",toop); },1000); }else{ $(".total .total-con .total-left .total-list ul").css("transition","0.8s"); $(".total .total-con .total-left .total-list ul").css("top",toop); } },2000); } ); /*案例左右滚动*/ var n=$("#oi .carousel-inner .item").length; var wid=parseInt($("#oi .carousel-inner .item").css("width"))+15; $("#oi .carousel-inner").css("width",wid*n); $(".case_main_list #myCarousel .carousel-indicatorsss").on("click","li",function () { var left=parseInt($("#oi .carousel-inner").css("left")); if($(this).attr("class")=="pre"){ left-=wid; if(left<-wid*(n-4)){left=-wid*(n-4)} $("#oi .carousel-inner").css("left",left); }else{ left+=wid; if(left>0){left=0} $("#oi .carousel-inner").css("left",left); } }) var timer=setInterval(function(){ var left=parseInt($("#oi .carousel-inner").css("left")); left-=wid; if(left<-wid*(n-4)){left=0} $("#oi .carousel-inner").css("left",left); },2500);