微信小程序页面滚动到某个位置添加类,盒子置顶效果。 ...
页面结构大致如上。 下面是js data里面先定义一下scrollTop. 其实不是很难 ...
2017-03-10 13:51 0 2525 推荐指数:
微信小程序页面滚动到某个位置添加类,盒子置顶效果。 ...
<view class="box1" bindtap="toComment">查看回答</view> //...其他内容 <view class="box2 text-bold" id="comment">回答</view> ...
页面上有一个元素或者组件,id 为 comment 则: var me = this; var query = wx.createSelectorQuery().in(me); ...
公司项目要做一个类似微信通讯录导航的效果,点击右侧字母页面滚动到相应位置。 因为微信小程序没有dom概念,所以不能使用锚点,也不能直接获取对应字母相对页面的偏移位置。此时只能使用小程序创建对象实例的API获取节点信息: 解释一下该代码的意思: 1.先创建 ...
1.html 2. ...
https://www.jianshu.com/p/8b4023c7b448 ...
其实很简单 控制 <map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" controls ...
scroll.wxml: scroll.js: ...