Framework7拉刷新组件未触发事件

时间:2019-05-10 19:39:20

标签: javascript html-framework-7

激活时,我的framework7刷新不触发'ptr:refresh'。当我按下鼠标时,UI会响应并显示箭头,但此操作似乎未触发javascript事件。

<div class="page-content ptr-content">
    <div class="ptr-preloader">
        <div class="preloader"></div>
        <div class="ptr-arrow"></div>
    </div>
    <div class="list media-list">
        <ul class="rounded">
        </ul>
    </div>
</div>
 
var ptr = app.ptr.get('.ptr-content');

ptr.on('ptr:refresh', function (e) {
  console.log('This does not fire!');
});

1 个答案:

答案 0 :(得分:0)

请尝试先获取元素

var ptr = $('.ptr-content');

然后添加事件监听器

ptr.on('ptr:refresh', function (e) {
   console.log('This does not fire!');
});