收藏
回答

scroll-view 的事件为什么不能触发?



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("快到底部");

},

除了单击事件,没有一个事件是能触发的!

最后一次编辑于  2017-12-10
回答关注问题邀请回答
收藏

1 个回答

  • David
    David
    2018-01-09

    试试scroll-x改成scroll-y='true'

    2018-01-09
    有用
    回复
登录 后发表内容