jQuery学习示例------点击红色方块实现左右晃动-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
jQuery学习示例------点击红色方块实现左右晃动



	test
	
	
	  $(function(){
	  	$("div").click(function(){
	  		if($(this).hasClass("red")){
	  			$(this)
	  			       .animate({left:120})
	  			       .animate({left:240})
	  			       .animate({left:0})
	  			       .animate({left:240})
	  			       .animate({left:120});
	  		}
	  	})
	  });
      
	
	
	  div{
	  	position: absolute;
	  	width: 100px;
	  	height: 100px;
	  }
	  .blue{
	  	left: 0px;
	  	background: blue;
	  }
	  .red{
	  	left: 120px;
	  	background: red;
	  	z-index: 1;
	  }
	  .green{
	  	left: 240px;
	  	background: green;
	  }
	  .pos{
	  	top: 120px;
	  }
	


    
    
    
    

成都创新互联自2013年起,先为凤城等服务建站,凤城等地企业,进行企业商务咨询服务。为凤城企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。

运行结果:

jQuery学习示例------点击红色方块实现左右晃动

jQuery学习示例------点击红色方块实现左右晃动


网站栏目:jQuery学习示例------点击红色方块实现左右晃动
转载来源:http://scgulin.cn/article/ppcocj.html