鼠标点击按钮图片切换+自动切换+左右按钮点击切换效果上一次在我的文库中分享了点击按钮 图片左右切换轮播效果代码今天主要是分享【鼠标点击按钮 图片进行切换+图片自动切换+点击左右按钮图片进行切换的三种效果的组合代码】。
最后的效果如下
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");});
});
今天获得消息,vdsina上了AMD EPYC系列的VDS,性价比比较高,站长弄了一个,盲猜CPU是AMD EPYC 7B12(经过咨询,详细CPU型号是“EPYC 7742”)。vdsina,俄罗斯公司,2014年开始运作至今,在售卖多类型VPS和独立服务器,可供选择的有俄罗斯莫斯科datapro和荷兰Serverius数据中心。付款比较麻烦:信用卡、webmoney、比特币,不支持PayPal...
HostKvm商家我们也不用多介绍,这个服务商来自国内某商家,旗下也有多个品牌的,每次看到推送信息都是几个服务商品牌一起推送的。当然商家还是比较稳定的,商家品牌比较多,这也是国内商家一贯的做法,这样广撒网。这次看到黑五优惠活动发布了,针对其主打的香港云服务器提供终身6折的优惠,其余机房服务器依然是8折,另还有充值50美元赠送5美元的优惠活动,有需要的可以看看。HostKvm是一个创建于2013年的...
TabbyCloud迎来一周岁的生日啦!在这一年里,感谢您包容我们的不足和缺点,在您的理解与建议下我们也在不断改变与成长。为庆祝TabbyCloud运营一周年和七夕节,TabbyCloud推出以下活动。TabbyCloud周年庆&七夕节活动官方网站:https://tabbycloud.com/香港CN2: https://tabbycloud.com/cart.php?gid=16购买链...