js实现京东轮播图效果
(编辑:jimmy 日期: 2025/11/13 浏览:3 次 )
本文实例为大家分享了js实现京东轮播图效果的具体代码,供大家参考,具体内容如下
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body,ul,li{padding:0;margin:0;}
li{list-style-type:none;}
.wrap{
position:relative;
width:480px;
height:260px;
margin:100px auto;
}
.wrap>ul>li{position:absolute;display:none;}
/*隐藏所有的li*/
.wrap img{width:480px;height:260px;}
.wrap li:first-child{display:block;}/*显示第一个*/
.arrow{
width:480px;
height:60px;
position:absolute;
top:50%;
margin-top:-30px;
display:none;
}
.arrow>span{
font-size:24pt;
line-height:60px;
display:inline-block;
width:36px;
background-color:#CEE5E8;
text-align:center;
cursor:pointer;
opacity:0.5;
border-radius:5px;/*显示圆框*/
-webkit-border-radius:5px;
-moz-border-radius:5px;
color:black;
}
.wrap:hover .arrow{
display:block;
}
.arrow>span:last-child{
float:right;
}
</style>
</head>
<body>
<div class="wrap">
<!--图片部分-->
<ul>
<li>
<a href="javascript:void(0)">
<img src="/UploadFiles/2021-04-02/1.jpg">
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
下一篇:jquery实现一个全局计时器(商城可用)