电商头部导航栏滑动效果

20 篇文章 0 订阅
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>menu</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link href="https://cdn.bootcss.com/Swiper/4.0.6/css/swiper.min.css" rel="stylesheet">
    <style>
        body{padding: 0;margin: 0}
        .swiper-slide{width: auto!important;}
        .topmenu{height: 35px;background-color: white;border-bottom: 1px solid #CCCCCC;padding: 0 20px;line-height: 35px;font-family: "微软雅黑"}
    </style>
</head>
<body id="mall">
<!-- Swiper -->
<div class="topmenu">
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <span class="swiper-slide">手机</span>
            <span class="swiper-slide">电器</span>
            <span class="swiper-slide">家居</span>
            <span class="swiper-slide">电影</span>
            <span class="swiper-slide">电视剧</span>
            <span class="swiper-slide">综艺</span>
            <span class="swiper-slide">腾讯视频</span>
            <span class="swiper-slide">爱奇艺</span>
        </div>
    </div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/Swiper/4.0.6/js/swiper.min.js"></script>
<script>
    $(function () {
        var swiper = new Swiper('.swiper-container', {
            spaceBetween: 20,
            slidesPerView:'auto',
            freeMode: true
        });
    })
</script>
</body>
</html>

请切换手机端查看

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值