欢迎光临,了解微信小程序开发,就上易用通!

实现微信好友列表点击右侧字母列表跳转对应位置效果

发布:2018-04-25 09:08浏览: 来源:网络 作者:cola

这个月,比较忙,遇到某位同学问我一个问题:在小程序里实现微信好友列表点击右侧字母列表跳转对应位置效果。写了个demo,核心部分很简单,所以没多少注释,如果遇到问题就加群问我吧。

核心技术点: 
1、小程序scroll-view组件的scroll-into-view, scroll-with-animation. scroll-y属性。 
2、小程序的touch事件的应用。 
3、Js定时器的应用。

view页面代码:

index.wxml


				
  1. <!--index.wxml-->
  2. <view class="container" scroll-y>
  3. <scroll-view class="info" id="info" scroll-with-animation scroll-y scroll-top="200" scroll-into-view="{{toView}}" style="height:{{height}}px;">
  4. <view class="iitem" id="{{item.id}}" wx:for="{{info_list}}" wx:key="1">





免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。