仿“今日头条”导航菜单左右滑动
来源:互联网 发布:编写c语言用什么软件 编辑:程序博客网 时间:2024/05/17 07:10
<div class="topmenu border-bottom-cd"> <div class="swiper-container"> <div class="swiper-wrapper"> <span class="swiper-slide padding" ng-click="selectedTab($index)" ng-repeat="slide in slides" id="{{slide.id}}" style="width:auto" ng-class="{true:'font-weight-bold color-f23c39 ',false:''}[slideIndex ==$index]">{{slide.name}}</span> <span class="swiper-slide padding width-percentage-10" ></span> <span class="swiper-slide padding width-percentage-10"></span> <span class="swiper-slide padding width-percentage-10"></span> <span class="swiper-slide padding width-percentage-10"></span> </div> </div></div><ion-slide-box show-pager="false" class="has-header" on-slide-changed="slideChanged($index)"> <ion-slide ng-repeat="slide in slides" > <div class="list"> <h2>title:{{slide.name}}</h2> </div> </ion-slide></ion-slide-box>
$scope.slides = [ {name: '健康资讯', id:1}, {name: '健康知识', id:2}, {name: '健康问答', id:3}, {name: '健康图书', id:4}, {name: '健康资讯', id:5}, {name: '健知识', id:6}, {name: '健问答', id:7}, {name: '健图书', id:8}, {name: '图书', id:9}, {name: '资讯', id:10}, {name: '知识', id:11}, {name: '问答', id:12}, {name: '图书', id:13}, {name: '健康资讯', id:14}, {name: '健康知识', id:15}, {name: '健康问答', id:16}, {name: '健康图书', id:17}, {name: '健康资讯', id:18},];$scope.slideIndex = 0;//初始化swipervar swiper = new Swiper('.swiper-container', { freeMode : true,});$scope.slideChanged = function (index) { $scope.slideIndex=index; //定位 $location.hash( $scope.slides[index].id); $anchorScroll();};$scope.selectedTab = function (index) { $scope.slideIndex=index; //滑动索引,跳转到指定地方 $ionicSlideBoxDelegate.slide(index)}
使用http://www.swiper.com.cn/swiper.js 插件安装 npm install swiper
阅读全文
0 0
- 仿“今日头条”导航菜单左右滑动
- js实现左右滑动的导航菜单,仿今日头条顶部菜单
- 仿今日头条顶部导航效果
- 仿今日头条滑动评论效果
- 仿网易/今日头条滑动视图
- 横向滑动菜单Tablayout和viewpager小圆点结合滑动仿今日头条
- Android源码解析-仿今日头条PagerSlidingTabStrip滑动页面导航效果
- 仿今日头条
- 仿今日头条
- 今日头条导航
- Android之仿今日头条顶部导航栏效果
- Android之仿今日头条顶部导航栏效果
- Android之仿今日头条顶部导航栏效果
- Android之仿今日头条顶部导航栏效果
- 纯jq仿今日头条导航栏
- TabLayout实现仿今日头条顶部tab导航效果
- Android Android HorizontalScrollView滚动实现仿今日头条滑动
- Android仿今日头条和知乎等App顶部滑动导航实现代码分析及源码下载
- 内部类
- mongo插入long类型数据
- jquery绑定click等事件无效解决方法live替代$().click不执行
- 17.12.12
- [Python]学习笔记(一)安装与使用
- 仿“今日头条”导航菜单左右滑动
- 线性代数第二章
- 类名.class.getName()的作用
- 机器学习整体框架整理
- 第十五周——项目四— 英文单词的基数排序
- 使用vultr+ shadowsocks打造自己的vpn
- spring boot 搭建【搭建基础框架】(一)
- (百万数据量级别)java下的mysql数据库插入越插越慢的问题解决
- linux mkdir -p参数 与 rm -r参数