zoukankan      html  css  js  c++  java
  • 微信小程序(8)--头部导航滑动

    项目需求:实现头部导航,可左右滑动。

    <view class="top-news">
         <view class="self-box">
    <view class="img-self">
    <image src="../../images/self.jpg"></image>
    </view>
    </view> <view class="self-add">
    <view class="img-add">
    <image src="../../images/add.jpg"></image>
    </view>
    </view> <view class="nav-scroll"> <scroll-view class="scroll-view_H" scroll-x="true" style=" 100%"> <text wx:for="{{section}}" wx:key="id" id="{{item.id}}" catchtap="handleTap" class="nav-name {{item.id == currentId ? 'nav-hover' : ''}}">{{item.name}}</text> </scroll-view> </view> </view>
    /* 头部滑动导航 */
    .top-news{100%;height: 50px;border-bottom:1px solid #349393;position: fixed;top:0;left:0;z-index: 999;overflow: hidden;background: linear-gradient(to right,#f3f3f3,#fff,#f3f3f3); }
    .self-box{position: absolute;left:0;height:50px;40px;display: inline-block;background: #fff;}
    .img-self{30px;height: 30px;padding-top:10px;padding-left: 5px;}
    .img-self image{100%;height: 100%;}
    .self-add{position: absolute;right:0;height:50px;40px;display: inline-block;background: #fff;}
    .img-add{30px;height: 30px;padding-top:10px;padding-left: 5px;}
    .img-add image{100%;height: 100%;}
    .scroll-view_H{white-space:nowrap; 100%;padding:6px 40px 0;box-sizing: border-box;}
    .nav-name{display:inline-block;font-size:16px;color: #2b2e33;border-bottom: 2px solid transparent;padding:10px;}
    .nav-hover{color: #349393;/* border-bottom: 2px solid #f06000; */}
    data: {
        section: [
          { name: '精选', id: '1001' }, { name: '黄金单身汉', id: '1032' },
          { name: '综艺', id: '1003' }, { name: '电视剧', id: '1004' },
          { name: '电影', id: '1005' }, { name: '少儿', id: '1021' }
        ]
      },
  • 相关阅读:
    C#动态调用webservice方法
    WinForm客户端调用 WebService时 如何启用Session
    C# 调用 Web Service 时出现 : 407 Proxy Authentication Required错误的解决办法
    ms sql 在任何位置 添加列
    Python requests
    LookupError: unknown encoding: cp65001
    [转]HTTP请求模型和头信息参考
    【原】使用StarUML画用例图
    【微信转载】Google是如何做测试的
    手机SD卡损坏补救措施
  • 原文地址:https://www.cnblogs.com/juewuzhe/p/7991592.html
Copyright © 2011-2022 走看看