打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
简单图片切换
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
list-style: none;
}
.con{
overflow: hidden;
position: relative;
margin: 200px auto 0;
width: 320px;
height: 220px;
padding: 20px;
border: 1px solid #000;
}
.main{
position: absolute;
left: 0;
top: 0;
width: 360px;
height: 260px;
}
.rq{
width: 1080px;
height: 260px;
}
.rq img{
float: left;
width: 360px;
height: 260px;
}
ul{
position: relative;
left: 50%;
bottom: -20px;
margin-left: -30px;
}
li{
float: left;
width: 10px;
height: 10px;
margin-right: 10px;
background: #f00;
border-radius: 50%;
cursor: pointer;
cursor: hand;
}
li:hover{
background: #000;
}
</style>
</head>
<body>
<div class="con">
<div class="main">
<div class="rq">
<img src="1.jpg">
<img src="2.jpg">
<img src="3.jpg">
</div>
</div>
</div>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</body>
<script type="text/javascript" src="jquery-1.9.1.js"></script>
<script type="text/javascript">
$('ul li').eq(0).click(function(){
$('.main').stop().animate({
left : '0px'
})
})
$('ul li').eq(1).click(function(){
$('.main').stop().animate({
left : '-360px'
})
})
$('ul li').eq(2).click(function(){
$('.main').stop().animate({
left : '-720px'
})
})

</script>
</html>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
jQuery——jQuery选择器 ※
图片轮播效果代码(html)
jquery图片滚动
CSS+JS自动改变切换方向的图片幻灯切换效果
响应式布局案例
原生js实现图片切换
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服