jQuery Mobile懒惰加载列表项 [英] jQuery Mobile lazy load list items

查看:89
本文介绍了jQuery Mobile懒惰加载列表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你怎么知道你在jQuery Mobile的列表底部,当到达列表的末尾时我需要延迟加载更多的结果?

How do you know that you are at the bottom of a list in jQuery Mobile, I need to lazy load in more results when the end of the list is reached?

推荐答案

这里有一个使用 scrollstart scrollstop 事件的工作示例,这应该让你朝着正确的方向前进: http://jsfiddle.net/shanabus/LJTJt/

There is a working example of using scrollstart and scrollstop events here, that should get you going in the right direction: http://jsfiddle.net/shanabus/LJTJt/

此处的文档页面: http://jquerymobile.com/test/docs/api/events.html

希望这会有所帮助!

更新

这篇文章,我能够连接一个更好的例子来检测页面底部。如果列表视图不在页面底部,则这也不起作用。检查控制台是否有一些位置调试信息。

With help from this post, I was able to wire up a better example that does detection against the bottom of the page. If your list view is not in the bottom of the page, this will not work as well. Check the console for some position debug information.

http://jsfiddle.net/shanabus/LJTJt/1/

此处只有当您到达列表底部时才会添加新项目。

Here it only adds a new item when you reach the bottom of the list.

这篇关于jQuery Mobile懒惰加载列表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆