栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > Web开发 > JavaScript

JavaScript--无限轮播加定时(1)

JavaScript 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

JavaScript--无限轮播加定时(1)

首先实现图片list内容随着time动作:
原理:通过每秒设置left的值的修改来操作
left为左边界终点


			#box{
				width: 400px;
				height: 200px;
				border: 5px solid red;
				margin: 0 auto;
				position: relative;
				margin-top: 100px;
				z-index: 5;
			}
			#img_list{
				position: absolute;
				width: 2000px;
			}
			#img_list>div{
				width: 400px;
				float: left;
				height: 200px;
				line-height: 200px;
				color: white;
				font-size: 28px;
				text-align: center;
				background: seagreen;
			}
			#arouse{
				width:400px;
				height: 20px;
				position: absolute;
				top: 100px;
				left: 0px;
			}
			#left{
				width: 20px;
				height: 20px;
				border: 1px solid;
				border-radius: 50%;
				text-align: center;
				line-height: 20px;
				float: left;
				color: white;
				background: chartreuse;
				display: inline-block;
			}
			#right{
				width: 20px;
				height: 20px;
				border: 1px solid;
				border-radius: 50%;
				text-align: center;
				line-height: 20px;
				color: white;
				background: chartreuse;
				display: inline-block;
				float: right;
			}
		
	
	
		
			1
			2
			3
			4
			5
		
		
			
			
			
			
			
		
		
			<
			>
		
	
	
	

1.也可以加图片,但是图片的格式尽量是.png的格式。
2.针对style的样式代表单独的样式声明,就是要添加一个style样式,样式的名称叫做left,left是positioning的属性之一,可以查阅Dom style属性

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/245956.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号