网页图片轮播
来源:互联网 发布:ui界面设计用什么软件 编辑:程序博客网 时间:2024/05/08 07:55
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
#spanbtn span{
display:inline-block;
width:18px;
height:18px;
border:#fff 1px solid;
text-align:center;
margin-right:2px;
}
#spanbtn span:hover{color:#f00;}
</style>
<script >
function showobj(id)
{
var obj=document.getElementById(id);
obj.style.display="";
}
function hiddenobj(id)
{
var obj =document.getElementById(id);
obj.style.display="none";
}
var arr=new Array;
arr[0]="1.jpg";
arr[1]="2.jpg";
arr[2]="3.jpg";
arr[3]="4.jpg";
var count=0;
function autoPlayer()
{
if(arr.length==count)
count=0;
document.getElementById("banner").src=arr[count];
count++;
}
var Timer=setInterval(autoPlayer,2000);
//清除定时器对象
function clearTimer()
{
clearInterval(Timer);
}
//鼠标悬停时指定播放的图片
function showbannerbyid(num)
{
clearTimer();
var index=parseInt(num);
document.getElementById("banner").src=arr[index-1];
count=index;
}
//鼠标离开恢复自动播放效果
function btnMouseOut()
{
Timer=setInterval(autoPlayer,2000);
}
</script>
</head>
<body>
<div id="bannerbox" style="position:relative">
<div>
<img id="banner" width="500px" src="1.jpg"/>
</div>
<div id="spanbtn" style="position:absolute; right:800px;bottom:10px;">
<span onmouseover="showbannerbyid(1)" onmouseout="btnMouseOut()">1</span>
<span onmouseover="showbannerbyid(2)" onmouseout="btnMouseOut()">2</span>
<span onmouseover="showbannerbyid(3)" onmouseout="btnMouseOut()">3</span>
<span onmouseover="showbannerbyid(4)" onmouseout="btnMouseOut()">4</span>
</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
#spanbtn span{
display:inline-block;
width:18px;
height:18px;
border:#fff 1px solid;
text-align:center;
margin-right:2px;
}
#spanbtn span:hover{color:#f00;}
</style>
<script >
function showobj(id)
{
var obj=document.getElementById(id);
obj.style.display="";
}
function hiddenobj(id)
{
var obj =document.getElementById(id);
obj.style.display="none";
}
var arr=new Array;
arr[0]="1.jpg";
arr[1]="2.jpg";
arr[2]="3.jpg";
arr[3]="4.jpg";
var count=0;
function autoPlayer()
{
if(arr.length==count)
count=0;
document.getElementById("banner").src=arr[count];
count++;
}
var Timer=setInterval(autoPlayer,2000);
//清除定时器对象
function clearTimer()
{
clearInterval(Timer);
}
//鼠标悬停时指定播放的图片
function showbannerbyid(num)
{
clearTimer();
var index=parseInt(num);
document.getElementById("banner").src=arr[index-1];
count=index;
}
//鼠标离开恢复自动播放效果
function btnMouseOut()
{
Timer=setInterval(autoPlayer,2000);
}
</script>
</head>
<body>
<div id="bannerbox" style="position:relative">
<div>
<img id="banner" width="500px" src="1.jpg"/>
</div>
<div id="spanbtn" style="position:absolute; right:800px;bottom:10px;">
<span onmouseover="showbannerbyid(1)" onmouseout="btnMouseOut()">1</span>
<span onmouseover="showbannerbyid(2)" onmouseout="btnMouseOut()">2</span>
<span onmouseover="showbannerbyid(3)" onmouseout="btnMouseOut()">3</span>
<span onmouseover="showbannerbyid(4)" onmouseout="btnMouseOut()">4</span>
</div>
</div>
</body>
</html>
1 0
- 网页图片轮播
- 网页图片轮播
- 网页图片轮播
- 网页Flash实现图片轮播特效
- 基于bootstrap的网页开发之图片轮播
- 网页标题图片以及原生h5+C3轮播
- myFocus制作网页焦点图 实现图片轮播效果
- 图片轮播
- 腾讯图片轮播
- js图片轮播
- js图片轮播
- JavaScript 图片轮播
- js图片轮播
- jquery 图片轮播
- jquery图片轮播
- 图片轮播
- 图片轮播
- 图片轮播插件
- CSS 引入的4种方式
- 纯CSS3多列的瀑布流布局演示
- 用Swift做个游戏Lecture10 —— 优化游戏(终结篇)
- maven提示jdk版本或项目版本问题
- HDU 5578.Friendship of Frog【字符串相同字符最近距离】【2015ACM/ICPC亚洲区上海站】【12月30】
- 网页图片轮播
- android AsyncTask介绍 AsyncTask和Handler对比
- js的三种方法类型
- JS获取日期周数(含年份)
- andorid下从相册选取/拍照选取一张相片并剪切
- poj 2152 Fire 树形DP ★★★★
- Windows命令行
- 音 + 视频播放
- Linux平台Makefile文件的编写基础篇