scroll-view 当距离项部和底部多少时就触发事件,为什么我的代码不能触发,哪里写错了?
<scroll-view scroll-x bindscrolltoupper="250" scrolltoupper="DingB" bindscrolltolower="250" scrolltolower="DiB" style= "height:3000rpx; width: 750rpx;flex-direction:row;" >
<view class="ys" wx:for="{{t}}" wx:for-item="t" src="{{t}}" style="background:url('{{t}}');background-size:250rpx;display:flex;flex-direction:row;float:left;">{{zhiwu[index]}}view>
scroll-view>
JS部分
DingB: function () { //距离顶部一定距离时触发该函数
console.log("快到顶部");
},
DiB: function () { //距离底部一定距离时触发该函数
console.log("快到底部");
},
除了单击事件,没有一个事件是能触发的!
试试scroll-x改成scroll-y='true'