下拉以刷新HTML格式的移动网络浏览器。
如果需要下拉屏幕以刷新页面以获取最新更新,可以在JavaScript,xhttprequests和touch事件的帮助下完成此操作。
拉刷新是AJAX中XHR的触发器,它将新数据添加到所需的元素中。
可以使用劫持的JavaScript滚动机制(例如iscroll)来实现拉刷新。Twitter正在使用iscroll拉刷新选项。
另一种方法是为溢出的:scroll组件创建刷新处理程序。
提供的接口可以提供有关处理程序接口的想法-
var PullToRefresh= function(callback, wrapper, instructionsText) {
//它创建dom元素并将其附加在内容包装器之前
// <div class="mainWrapper" style="overflow: scroll; height: 600px;">
<div class="pullToReloadWrapper"></div><div class = "contentWrapper"></div>
</div> is the markup.
// if main wrapper's height is > than content wrapper's
height, then change the main wrapper height to be the height of the content wrapper.
//滚动主包装。
// invoke initializeEvents() to inititalize the events
};热门推荐
10 朋友结婚致辞祝福语简短
11 鱼的内涵简短祝福语
12 撩妹生日祝福语简短
13 道教生日祝福语简短大全
14 毕业祝福语简短给同学
15 新年发给客户祝福语简短
16 升学祝福语简短的个性
17 冬季祝福语大全 简短的
18 枣庄人事考试祝福语简短