<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<style>
.banner{
width:300px;
height:250px;
position: relative;
z-index: 100;
background: skyblue;
margin:100px auto;
overflow:hidden ;
}
.banner .first{
left:0;
}
.banner a{
width: 100%;
height: 100%;
position: absolute;
display:block;
top:0;
left:100%;
}
.banner a img{
width: 100%;
height: 100%;
}
.banner .pre{
position: absolute;
left:0;
top:120px;
background: gray;
width:30px;
height:30px;
border-radius: 30px;
line-height: 30px;
text-align: center;
opacity: 0.4;
z-index: 1000;
cursor: pointer;
}
.banner .next{
position: absolute;
right:0;
top:120px;
background: gray;
width:30px;
height:30px;
border-radius: 30px;
line-height: 30px;
text-align: center;
opacity: 0.4;
z-index: 1000;
cursor: pointer;
}
.choose{
position: absolute;
width:100px;
height:20px;
bottom:10px;
left:90px;
z-index: 1000;
}
.choose span{
display: block;
float: left;
margin-left:15px;
width:10px;
height:10px;
border-radius: 10px;
background: blue;
cursor: pointer;
}
.choose .red{
background: red;
}
</style>
</head>
<body>
<div class="banner">
<span class="pre"><=</span>
<span class="next">=></span>
<a href="#" class="first"><img src="./1.jpg" alt=""/></a>
<a href="#"><img src="./2.jpg" alt=""/></a>
<a href="#"><img src="./3.jpg" alt=""/></a>
<a href="#"><img src="./4.jpg" alt=""/></a>
<div class="choose">
<span class="red"></span>
<span></span>
<span></span>
<span></span>
</div>
</div>
</body>
<script src="./jquery.min.js"></script>
<script>
var $index = 0;
var $exdex = 0;
$('.choose span').mouseover(function(){
$index = $(this).index();
$('.choose span').eq($index).addClass("red").siblings().removeClass("red");
if($index > $exdex) {
next();
} else {
pre();
}
return $exdex = $index;
});
function next() {
$('.banner a').eq($index).stop(true,true).css('left',"100%").animate({"left":0});
$('.banner a').eq($exdex).stop(true,true).css('left',"0").animate({"left":"-100%"});
}
function pre() {
$('.banner a').eq($index).stop(true,true).css('left',"-100%").animate({"left":"0"});
$('.banner a').eq($exdex).stop(true,true).css('left',"0").animate({"left":"100%"});
}
</script>
</html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有