js实现带垂直下拉菜单和图片轮换图一体电商首页效果代码

代码语言:html

所属分类:菜单导航

代码描述:js实现带垂直下拉菜单和图片轮换图一体电商首页效果代码

代码标签: 垂直 下拉菜单 图片 轮换 一体 电商 首页 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/font-awesome-4.7.0/css/font-awesome.min.css">
<style>
    * {
	margin: 0;
	padding: 0;
}

ul {
	list-style: none;
}

body {
	font-family: "微软雅黑";
	color: #14191e;
	background-color: #2A2A2A;
}

.main {
	width: 1200px;
	height: 460px;
	margin-top: 50px;
	margin-right: auto;
	margin-left: auto;
	margin-bottom: auto;
	overflow: hidden;
	position: relative;
}

.banner {
	height: 460px;
	margin-left:245px;
	width: 956px;
	overflow: hidden;
	position: relative;
}

.banner-slide {
	height: 460px;
	width: 956px;
	background-repeat: no-repeat;
	position: absolute;
	display: none;
}

.slide1 {
	background-image: url(//repo.bfw.wiki/bfwrepo/image/5e0e95ca07b8a.png);
	background-size: cover;
}

.slide2 {
	background-image: url(//repo.bfw.wiki/bfwrepo/image/5e0e95ca07b8a.png);
		background-size: cover;
}

.slide3 {
	background-image: url(//repo.bfw.wiki/bfwrepo/image/5e0e95ca07b8a.png);
		background-size: cover;
}

.slide_active {
	display: block;
}

.button {
	position: absolute;
	width: 40px;
	height: 80px;
	left: 244px;
	top: 50%;
	margin-top: -40px;
	background: url(//repo.bfw.wiki/bfwrepo/icon/6068f15932bf6.png) center center no-repeat;
}

.prev {
	transform: rotate(180deg);
}

.next {
	left: auto;
	right: 0;
}

.button:hover {
	background-color: #333;
	opacity: 0.6;
	filter: alpha(opacity=60);
}

.dots {
	position: absolute;
	right: 0;
	bottom: 24px;
	text-align: right;
	right: 20px;
}

.dots span {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: rgba(7, 17, 27, 0.4);
	margin-left: 8px;
	line-height: 12px;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8) inset;
	cursor: pointer;
}

.dots span.active {
	box-shadow: 0 0 0 2px rgba(7, 17, 27, 0.4) inset;
	background: #fff;
}

.menu-box{
	width: 244px;
	height: 460px;	
	position: absolute;
	left: 0;
	top: 0;
	background: rgba(7,17,27,0.5);
	opacity:0.5;
	z-index:1;
	
}
.menu-contern{
	width: 244px;
	height: 454px;
	position: absolute;
	left: 0;
	top: 0;
	z-index:2;
	padding-top:6px;
}
.menu-item{
	height: 64px;
	line-height: 66px;
	font-size: 16px;
	padding:0 24px;
	position: relative;}
.menu-item a:link,.menu-item a:visited{
	color: #fff;
}
.menu-item a{
	display: block;
	border-bottom: 1px solid rgba(255,255,255,0.2);
	padding:0 8px;
	height:63px;
	text-decoration: none;
	}

.menu-item i{
	position:absolute;
	right:32px;
	font-size:32px;
	top:2px;
top: 18px;
	font-style:normal;
	font-weight:normal;
	color: rgba(255,255,255,0.5);
}
.sub-menu{
   opacity: 0.9;
	width:730px;
	height: 458px;
	border: 1px solid #d9dde1;
	background:#fff;
	position:absolute;
	left:244px;
	top:0;
	z-index:99;
	box-shadow: 0 4px 8px 0 rgba(0,0,0,0.1);
}
.inner-box{
	width:100%;
	height: 100%;

	display: none;
}
.sub-inner-box{
	width: 652px;
	margin-left: 40px;
	overflow: hidden;
}
.tittle{
	color: #f01414;
	font-size: 16px;
	line-height: 16px;
	margin:28px 0 30px 0;
	font-weight:bold;	
	margin-bottom: 30px;
}
.bold{
	font-weight:bold;}
.mr10{
	margin-right:20px;
}
.ml10{
	margin-left: 20px;
}
a{
	text-decoration: none;
	color: #333;
}
.sub-row{
	margin-bottom:25px;
}
.hide{
	display: none;
}

</style>
</head>
<body>

<div class="main" id="main">
	<div class="menu-box">

	</div>
	<!--子-->
	<div class="sub-menu hide" id="sub-menu">
		<!--手机-->
		<div class="inner-box ">
			<div class="sub-inner-box">
				<div class="tittle">手机、配件</div>
				<div class="sub-row">
					<span class="bold mr10">手机通讯:</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
				</div>
				<div class="sub-row">
					<span class="bold mr10">手机通讯:</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
				</div>
				<div class="sub-row">
					<span class="bold mr10">手机通讯:</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
				</div>

			</div>

		</div>
		<!--电脑-->
		<div class="inner-box">
			<div class="sub-inner-box">
				<div class="tittle">电脑</div>
				<div class="sub-row">
					<span class="bold mr10">手机通讯:</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
				</div>
				<div class="sub-row">
					<span class="bold mr10">手机通讯:</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
				</div>
				<div class="sub-row">
					<span class="bold mr10">手机通讯:</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
				</div>

			</div>

		</div>
		<!--电器-->
		<div class="inner-box">
			<div class="sub-inner-box">
				<div class="tittle">电器</div>
				<div class="sub-row">
					<span class="bold mr10">手机通讯:</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr10">/</span>
					<a href="#">手机</a>
					<span class="ml10 mr1.........完整代码请登录后点击上方下载按钮下载查看

网友评论0