页面效果图:
代码部分:
html
图片轮播
<div class="leader">
<ul class="leader-list">
<li class="m-tag-a " data-target="_blank" data-src="op/content?id=r9509d039c0bc6bc4">
<img class="" src="img/mi.jpg" alt="">
</li>
<li class="m-tag-a " data-target="_blank" data-src="https://home.mi.com/app/shop/content?id=s8939d03918810635">
<img class="" src="img/jia.jpg" >
</li>
<li class="m-tag-a " data-target="_blank" data-src="https://home.mi.com/app/shop/content?id=Vcec75039f10ed7b3">
<img class="" src="img/can.jpg" alt="">
</li>
<li class="m-tag-a " data-target="_blank" data-src="https://home.mi.com/app/shop/content?id=p6058d0391d0c44b2&source=shop">
<img class="" src="img/pai.jpg" alt="">
</li>
<li class="m-tag-a no-mr" data-target="_blank" data-src="https://home.mi.com/app/shop/content?id=rd7a5503942d69884">
<img class="" src="img/zhen.jpg" alt="">
</li>
</ul>
</div>
css
.leader {
width: 1080px;
margin: 0 auto;
}
.leader-list{
height: 144px;
overflow: hidden;
padding-bottom: 10px;
border-bottom: 1px solid #e7e7e7;
}
.leader-list li {
float: left;
width: 130px;
margin-right: 107px;
}
.leader-list img {
width: 130px;
height: 144px;
}
.leader-list li:last-child {
margin-right: 0;
}
.m-tag-a {
cursor: pointer;
}
.section {
margin-top: 90px;
height: 267px;
}
.sec-top {
position: relative;
z-index: 99;
margin-bottom: 20px;
}
.subTit {
color: #333;
font-size: 24px;
font-weight: 400;
display: block;
float: left;
}
.subTit span {
margin-left: 10px;
font-size: 14px;
color: #999;
}
.sec-top .more {
position: absolute;
right: 0;
top: 6px;
font-size: 14px;
color: #666;
}
.goods-wrap1 .good-yx {
width: 538px;
}
.goods-wrap1 .no-ml {
margin-left: 0;
}
.layer-con {
position: relative;
height: 206px;
width: 538px;
top:60px;
}
/*商品列表*/
/*手机*/
.goods-list{
margin-top: 90px;
height: 991px;
}
.h-goods-sec {
margin-top: 50px;
}
.goods-list .container {
width: 1080px;
margin: 0 auto;
height: 100%;
}
.m-randomBg-top {
margin-bottom: 5px;
height: 370px;
}
.clearfix {
}
.m-spacial-guide {
width: 266px;
height: 370px;
position: relative;
text-align: center;
background-image: url(/static/media/bg.84cf2820.png);
background-position: 50%;
background-size: 100%;
background-repeat: no-repeat;
}
.m-spacial-guide .top-tit {
padding-top: 170px;
font-size: 28px;
color: #fff;
}
.m-spacial-guide .m-more {
position: absolute;
bottom: 30px;
left: 0;
display: block;
width: 100%;
color: #fff;
font-size: 14px;
}
.m-randomBg-img {
width: 809px;
height: 370px;
overflow: hidden;
}
.m-randomBg-img img {
width: 100%;
height: 370px;
}
.goods-list .m-product-list .pro-item.first {
margin-left: 0;
}
.h-product-list1 .pro-item {
width: 264px;
padding-bottom: 0;
border: 1px solid #e7e7e7;
}
.h-goods-sec .pro-item {
background: none;
}
.goods-list .m-product-list .pro-item {
position: relative;
float: left;
width: 264px;
margin-left: 5px;
margin-bottom: 5px;
text-align: center;
background: #fff;
-webkit-transition: all .4s;
transition: all .4s;
}
.h-product-list1 .pro-desc {
color: #845f3f;
font-size: 16px;
}
.h-product-list1 .h-text-inner {
margin-top: 10px;
padding: 5px 0 10px;
background: #ececec;
}
.h-product-list1 .pro-info {
color: #333;
font-size: 16px;
}
.goods-list .m-num{
font-size: 13px;
}
/*页面底部*/
.m-footer {
margin-top: 90px;
padding: 45px 0;
height: 45px;
line-height: 23px;
border-top: 1px solid #e7e7e7;
background-color: #fff;
color: #666;
}
.m-footer .m-f-logo img {
width: 123px;
height: 45px;
margin-right: 25px;
}
.m-footer .f-info {
position: relative;
padding-right: 138px;
font-size: 12px;
}
.m-footer .f-icons {
position: absolute;
top: 4px;
right: 0;
padding-left: 14px;
}
.m-footer .f-icons img {
width: 100px;
}
js
$(function() {
var bannerSlider = new Slider($('#banner_tabs'), {
time: 5000,
delay: 400,
event: 'hover',
auto: true,
mode: 'fade',
controller: $('#bannerCtrl'),
activeControllerCls: 'active'
});
$('#banner_tabs .flex-prev').click(function() {
bannerSlider.prev()
});
$('#banner_tabs .flex-next').click(function() {
bannerSlider.next()
});
})
//页面的显示隐藏功能
$(document).ready(function(){
var $menu=$(".nav-menu");
console.log($menu);
// $(".first").hover(function(){
// $menu.fadeIn(800);}
// , function(){
// $menu.fadeOut();
// });
$(".first").hover(function(){
$menu.fadeIn(800);
});
$(".nav-menu").mouseout(function(){
$menu.hide(800);
});
$(".load").hover(function(){
$(".pop-load").toggle();
});
$(".gift").hover(function(){
$(".pop-gift").toggle();
});
$(".mobile-icon").hover(function(){
$(".download").toggle();
});
//回到顶部功能部分
$(window).scroll(function(){
var sc=$(window).scrollTop();
var rwidth=$(window).width()
if(sc>0){
$("#to_top").css("display","block");
$("#to_top").css("left",(rwidth-36)+"px")
}else{
}
})
$("#to_top").click(function(){
var sc=$(window).scrollTop();
$('body,html').animate({scrollTop:0},500);
})
});