鼠标点击按钮图片切换+自动切换+左右按钮点击切换效果上一次在我的文库中分享了点击按钮 图片左右切换轮播效果代码今天主要是分享【鼠标点击按钮 图片进行切换+图片自动切换+点击左右按钮图片进行切换的三种效果的组合代码】。
最后的效果如下
Html代码部分
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>图片轮播效果制作</title>
<l ink rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/style.js"></script>
</head>
<body>
<divclass="banner">
<ulclass="pic">
<l i>
<a href="#"><img src="image s/1.jpg" alt="美女" width ="350" height="495"></a>
</l i>
<l i>
<a href="#"><img src="image s/2.jpg" alt="美女" width ="350" height="495"></a>
</l i>
<l i>
<a href="#"><img src="image s/3.jpg" alt="美女" width ="350" height="495"></a>
</l i>
<l i>
<a href="#"><img src="image s/4.jpg" alt="美女" width ="350" height="495"></a>
</l i>
<l i>
<a href="#"><img src="image s/5.jpg" alt="美女" width ="350" height="495"></a>
</l i>
</ul>
<ulclass="anniu">
<l iclass="on"></l i>
<l i></l i>
<l i></l i>
<l i></l i>
<l i></l i>
</ul>
<ulclass="lr">
<l iclass="pre"><a href="#"><</a></l i>
<l iclass="next"><a href="#">></a></l i>
</ul>
</div>
</body>
</html>
Css代码部分
*{margin:0px;padding:0px}
l i{l ist-style:none}a{text-decoration:none}img{border:0px}
.banner{width:350px;height:495px;margin:100px auto;position:relative;overflow:hidden}.banner .pic{width:9999px;height:495px}
.banner .pic l i{width:350px;height:495px;float: left}
.banner .anniu{width:100px;height:16px;position:absolute; left:165px;top:470px}
.banner .anniu l i{width:16px;height:16px;background:white;float: left;margin:2px;display: inl ine;cursor:pointer;border-radius:100%}
.banner .anniu l i .on{background:red}
.banner . lr{width:350px;height:50px;position:absolute;top:250px;display:none}
.banner . lra{color:white}
.banner . lr .pre{width:20px;height:50px;float: left;background:none repeat scrol l 0px 0px rgba(1,0,0,0.6);text-al ign:center; l ine-height:50px;cursor:pointer}
.banner . lr .next{width:20px;height:50px;float:right;background:none repea tscrol l 0px 0pxrgba(1,0,0,0.6);text-al ign:center; l ine-height:50px;cursor:pointer}
Javascript代码部分
$(function(){
//鼠标滑过b anner左右按钮进行显示和隐藏
$(".banner").hover(function(){
$(". lr").show();
},function(){
$(". lr").hide();
});
//点击下面的小按钮 图片进行左右切换效果
$(".anniul i").cl ick(function(){
$(this).addClass("on").sibl ings().removeClass("on");varnum=$(this). index();
$(".pic").animate({marginLeft:-350*num},"slow");
});
//图片自动轮播效果va r a=0;var automatic=setInterval(function(){a++;a=a%5;
$(".pic").animate({marginLeft:-350*a},"slow");
$(".anniu l i").eq(a).addClass("on").sibl ings().removeClass("on");
},6000);
//点击左右按钮 图片进行切换效果
$(".pre").cl ick(function(){a--;a=(a+5)%5;
$(".pic").animate({marginLeft:-350*a},"slow");
$(".anniu l i").eq(a).addClass("on").sibl ings().removeClass("on");});
$(".next").cl ick(function(){a++;a=a%5;
$(".pic").animate({marginLeft:-350*a},"slow");
$(".anniu l i").eq(a).addClass("on").sibl ings().removeClass("on");});
});
关于CYUN商家在之前有介绍过一次,CYUN是香港蓝米数据有限公司旗下的云计算服务品牌,和蓝米云、蓝米主机等同属该公司。商家主要是为个人开发者用户、中小型、大型企业用户提供一站式核心网络云端部署服务,促使用户云端部署化简为零,轻松快捷运用云计算。目前,CYUN主要运营美国、香港、台湾、日本、韩国CN2线路产品,包括云服务器、站群服务器和独立服务器等。这次看到CYUN夏季优惠活动发布了,依然是熟悉的...
inlicloud怎么样?inlicloud(引力主机)主要产品为国内NAT系列VPS,目前主要有:上海联通NAT(200Mbps带宽)、宿州联通NAT(200Mbps带宽)、广州移动NAT(200Mbps带宽)。根据官方的说法国内的NAT系列VPS不要求备案、不要求实名、对中转要求也不严格,但是,禁止任何形式的回国!安徽nat/上海联通/广州移动/江门移动nat云主机,2核1G/200Mbps仅...
ZJI原名维翔主机,是原来Wordpress圈知名主机商家,成立于2011年,2018年9月更名为ZJI,提供香港、日本、美国独立服务器(自营/数据中心直营)租用及VDS、虚拟主机空间、域名注册业务。ZJI今年全新上架了台湾CN2线路服务器,本月针对香港高主频服务器和台湾CN2服务器提供7折优惠码,其他机房及产品提供8折优惠码,优惠后台湾CN2线路E5服务器月付595元起。台湾一型CPU:Inte...