ws2z3gr2017 7 years ago
parent
commit
7c8229c77c
4 changed files with 8 additions and 9 deletions
  1. 1 1
      src/css/index_home.css
  2. 2 2
      src/js/index.js
  3. 4 5
      src/js/public.js
  4. 1 1
      template/index.html

+ 1 - 1
src/css/index_home.css

@@ -120,7 +120,7 @@ display:inline-block;position: absolute;top:0;left:0;}
     padding-left:45px;margin-top:15px;}
 .text_bottom p{font-weight: bold;line-height: 25px;}
 .text_bottom a{color:#fff;font-size: 1.2rem;line-height: 18px;}
-
+.pol_act{margin-left: 5px;}
 /*左右轮播*/
 .carousel{position: relative;width: 1200px;}
 .need_imgs{width: 1018px;overflow: hidden;position: absolute;left: 50%;margin-left: -500px;top: 0;}

+ 2 - 2
src/js/index.js

@@ -13,14 +13,14 @@ $(function(){
 		if(k>lilengths-3){
 			k=0
 		}
-		$('.need_imgs ul').animate({'marginLeft':-(liwit+20)*k})
+		$('.need_imgs ul').animate({'marginLeft':-(liwit+20)*k},1000)
 	});
 	$('.need_prev').click(function(){
 		k--;
 		if(k<0){
 			k=lilengths-3
 		}
-		$('.need_imgs ul').animate({'marginLeft':-(liwit+20)*k})
+		$('.need_imgs ul').animate({'marginLeft':-(liwit+20)*k},1000)
 	});
 });
 

+ 4 - 5
src/js/public.js

@@ -18,10 +18,9 @@ $(function(){
 				playpre();   		   			
 		})
 	var curidx =0;
-	var mov = 1;
-	var lock=false;
+	var mov = 1;	
 		function playnext(){
-			$ct.animate({marginLeft:'-='+mov*imgWidth},function(){
+			$ct.animate({marginLeft:'-='+mov*imgWidth},1000,function(){
 				curidx+=mov;
 				if(curidx===imgCount){
 					$ct.css({marginLeft:0-imgWidth});
@@ -31,11 +30,11 @@ $(function(){
 			$('.index_tt .banner_txt').eq(curidx).show().siblings().hide();			
 		}		
 		function playpre(){
-			$ct.animate({marginLeft:'+='+mov*imgWidth},function(){
+			$ct.animate({marginLeft:'+='+mov*imgWidth},1000,function(){
 				curidx-=mov;
 				if(curidx<0){
 					$ct.css({marginLeft:0-imgWidth*imgCount});
-					curidx=2;
+					curidx=imgCount-1;
 				}    				
 			})
 			$('.index_tt .banner_txt').eq(curidx).show().siblings().hide();			

+ 1 - 1
template/index.html

@@ -244,7 +244,7 @@
 						<div class="data">2017-08-15</div>
 					</div>
 				</div>
-				<div class="pol_right_sm">
+				<div class="pol_right_sm pol_act">
 					<h3>成都科德向中国科协进行工作汇报</h3>
 					<p><a href="#">2017年4月13日,中国科协乔主任、冯处长在金坛县全国双创,2017年4月13日,中国科协乔主任、冯处长在金坛县全国双创</a>
 					</p>