用jquery动画实现的简单的图片轮播
来源:互联网 发布:在淘宝上买steam游戏 编辑:程序博客网 时间:2024/05/22 06:31
<!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>
<title>图片轮播</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="css/showpicturesinturn.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<style type="text/css">
div.pictures{
width:500px;
height:400px;
overflow: hidden;
position:relative;
float: left;
top:0;
left:-250px;
margin-left: 50%;
}
ul.picture {
width: 2000px;
float: left;
list-style: none;
position: relative;
}
.picture li{
width:500px;
height:400px;
float: left;
position: relative;
}
.number{
position: absolute;
top:350px;
left:350px;
list-style: none;
}
.number li{
color:#ddd;
float:left;
width:30px;
height:25px;
line-height: 25px;
text-align: center;
border: 1px solid #fff;
background-color:#6f4f67;
cursor: pointer;
}
</style>
</head>
<body id="showpicturesinturn">
<div class="pictures">
<ul class="picture">
<li><img src="images/mypicture1.png" title="我的图片1" alt="我的图片1"></li>
<li><img src="images/mypicture2.png" title="我的图片2" alt="我的图片2"></li>
<li><img src="images/mypicture3.png" title="我的图片3" alt="我的图片3"></li>
<li><img src="images/mypicture4.png" title="我的图片4" alt="我的图片4"></li>
</ul>
<ul class="number">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</div>
<script type="text/javascript" src="js/showpicturesinturn.js"></script>
<script type="text/javascript">
$(function(){
function animation()
{
showpicturesinturn = setInterval(function(){
if($(".picture li").css("left")=="-1500px"){
$(".picture li").css("left","0px");
}
else{
$(".pictures li").animate({left:"-=500px"});
}
},2000);
}
animation();
$(".number li").click(function(){
clearInterval(showpicturesinturn);
$(".picture li").css("left","-"+$(this).index()*500+"px");
animation();
});
});
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>图片轮播</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="css/showpicturesinturn.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<style type="text/css">
div.pictures{
width:500px;
height:400px;
overflow: hidden;
position:relative;
float: left;
top:0;
left:-250px;
margin-left: 50%;
}
ul.picture {
width: 2000px;
float: left;
list-style: none;
position: relative;
}
.picture li{
width:500px;
height:400px;
float: left;
position: relative;
}
.number{
position: absolute;
top:350px;
left:350px;
list-style: none;
}
.number li{
color:#ddd;
float:left;
width:30px;
height:25px;
line-height: 25px;
text-align: center;
border: 1px solid #fff;
background-color:#6f4f67;
cursor: pointer;
}
</style>
</head>
<body id="showpicturesinturn">
<div class="pictures">
<ul class="picture">
<li><img src="images/mypicture1.png" title="我的图片1" alt="我的图片1"></li>
<li><img src="images/mypicture2.png" title="我的图片2" alt="我的图片2"></li>
<li><img src="images/mypicture3.png" title="我的图片3" alt="我的图片3"></li>
<li><img src="images/mypicture4.png" title="我的图片4" alt="我的图片4"></li>
</ul>
<ul class="number">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</div>
<script type="text/javascript" src="js/showpicturesinturn.js"></script>
<script type="text/javascript">
$(function(){
function animation()
{
showpicturesinturn = setInterval(function(){
if($(".picture li").css("left")=="-1500px"){
$(".picture li").css("left","0px");
}
else{
$(".pictures li").animate({left:"-=500px"});
}
},2000);
}
animation();
$(".number li").click(function(){
clearInterval(showpicturesinturn);
$(".picture li").css("left","-"+$(this).index()*500+"px");
animation();
});
});
</script>
</body>
</html>
0 0
- 用jquery动画实现的简单的图片轮播
- jquery实现简单的轮播动画
- jQuery实现简单的图片轮播
- jQuery 简单的图片轮播特效
- 用jquery面向对象实现的简单的图片轮播,还能学习一下闭包哦
- 最简单的图片轮播实现
- javascript图片轮播的简单实现
- html简单图片轮播的实现
- 简单的点击实现图片轮播~
- 简单的图片轮播实现
- 用H5+jQuery实现图片轮播的手写代码
- 简单的图片、文字轮播,及切换动画
- jQuery实现简单的图片轮播(二)-增加左右(或上下)翻页功能
- jQuery实现简单图片的轮播(自右向左播放)
- 最简单的jQuery图片轮播插件
- 一个简单的jquery图片轮播插件
- 使用jQuery做简单的图片轮播效果
- 简单的图片轮播
- dede 列表页 上一页下一页 只要链接
- 如何删除微软拼音输入法2007
- 在fragment中添加上下文菜单
- Spring annotation 之lookup (方法注入)
- MFC消息机制逆向追踪
- 用jquery动画实现的简单的图片轮播
- textview属性
- Python DeprecationWarning 类型错误
- DriverStudio工具包介绍
- Xilinx实现基于BlockRAM的高效移位寄存器
- State Threads 回调终结者
- jsp与servlet的联系
- EJB中的拦截器
- java mongodb 修改