zoukankan      html  css  js  c++  java
  • jq 高级轮播图

    <!doctype html>
    <html lang="en">
    <head>
    	<meta charset="UTF-8" />
    	<title>Document</title>
    	<style>
    		*{
    			margin: 0;
    			padding: 0;
    		}
    		#outer{
    			 760px;
    			height: 300px;
    			overflow: hidden;
    			position: relative;
    			margin: 100px auto 0;
    		}
    		#outer div{
    			position: absolute;
    			left: 0;
    			right: 0;
    			 760px;
    			height: 300px;
    			display: none;
    		}
    		.text{
    			position: absolute;
    			 760px;
    			height: 300px;
    			left: -760px;
    			top: 0px;
    		}
    		.con{
    			position: absolute;
    			 760px;
    			height: 300px;
    			left: -30px;
    			top: 0px;
    			display: none;
    		}
    		ul{
    			position: absolute;
    			right: 10px;
    			bottom: 10px;
    			list-style: none;
    			overflow: hidden;
    			z-index: 99;
    			height: 12px;
    			 80px;
    		}
    		.active{
    			background: white;
    		}
    	</style>
    </head>
    <body>
    	<div id="outer">
    		<div style="background: url(img/bg1.jpg) no-repeat; display: block;">
    			<img src="img/text1.png" alt="" class="text" style="left: 0;"/>
    			<img src="img/con1.png" alt=""  class="con" style="left: 0;display: block;"/>
    		</div>
    		
    		<div style="background:url(img/bg2.jpg) no-repeat;">
    			<img src="img/text2.png" alt="" class="text"/>
    			<img src="img/con2.png" alt="" class="con"/>
    		</div>
    		<div style="background: url(img/bg3.jpg) no-repeat;">
    			<img src="img/text3.png" alt="" class="text"/>
    			<img src="img/con3.png" alt="" class="con"/>
    		</div>
    		
    		<div style="background: url(img/bg4.jpg) no-repeat;">
    			<img src="img/text4.png" alt="" class="text" />
    			<img src="img/con4.png" alt="" class="con"/>
    		</div>
    		
    		<div style="background: url(img/bg5.jpg) no-repeat;">
    			<img src="img/text5.png" alt=""  class="text"/>
    			<img src="img/con5.png" alt="" class="con"/>
    		</div>
    		
    		<ul>
    			<li class="active"></li>
    			<li></li>
    			<li></li>
    			<li></li>
    			<li></li>
    		</ul>
    	</div>
    	
    	<script src="js/jquery-2.2.1.min.js"></script>
    	<script>
    		var page = 0;
    		var time = setInterval(function(){
    			page++;
    			if(page > 4)
    			{
    				page = 0;
    			}
    			$(".text").css({"left":"-760px"});
    			$(".con").css({"left":"-30px","display":"none"})
    			$("#outer div").fadeOut(200,function(){
    				$("#outer div").eq(page).fadeIn(200,function(){
    					$("li").removeClass("active").eq(page).addClass("active");
    					$(".text").eq(page).animate({"left":0},500,function(){
    						$(".con").eq(page).css("display","block").animate({"left":"0"})
    					})
    				})
    			})
    		},3000)
    	</script>
    </body>
    </html>
    

      

  • 相关阅读:
    Vue3.0 是如何变得更快的?
    阿里云 Centos7 安装mongodb
    ASP.Net Core5.0 EF Core使用记录
    MongoDB批量更新|按条件更新SQL|批量删除某个字段
    Layui单元格编辑获取修改前的值
    判断字符串出现的多个位置
    原生JavaScript的DOM操作汇总
    @Value值为null、#和$的区别
    Dubbo推荐用法
    Dubbo 服务化最佳实践
  • 原文地址:https://www.cnblogs.com/mingjixiaohui/p/5275146.html
Copyright © 2011-2022 走看看