您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

在HTML中的移动网页浏览器上下拉刷新

2024/3/9 13:42:40发布31次查看
当需要下拉屏幕以刷新页面以获取最新更新时,可以借助javascript、xhttprequests和触摸事件来实现。
下拉刷新是ajax中xhr的触发器。它向我们想要的元素添加新数据。
可以通过劫持javascript滚动机制(如iscroll)来实现下拉刷新。twitter正在使用iscroll来实现下拉刷新选项。
另一种方式是为overflow:scroll组件创建一个刷新处理程序。
提供的接口可以给出有关处理程序接口的想法−
var pulltorefresh= function(callback, wrapper, instructionstext) { //it creates dom elements and append them before content wrapper // <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. // scroll main wrapper. // invoke initializeevents() to inititalize the events};
以上就是在html中的移动网页浏览器上下拉刷新的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product