如何使用jQuery显示更多列表 [英] How to show more list using jquery

查看:136
本文介绍了如何使用jQuery显示更多列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拉出消息并使用PHP/MySQL进行显示.

I pull out messages and display with PHP/MySQL.

现在我只想显示10个列表.

Now I want to show only 10 lists.

我想添加按钮.当我单击此按钮时,它会平滑滑下并显示另外10条消息,共20条消息.

And I want to add button. When I click this button it slides down smoothly and shows another 10, total 20 messages.

如果我单击该按钮,它将再次向下滑动并显示总共30条消息.

And if I click the button it again slide down and shows total 30 messages.

请问有人可以教我如何使用jquery吗?

Could anyone teache me how to do it with jquery please?

谢谢.

推荐答案

在我的最新项目中,我使用

In my latest project, I use jQuery tools scrollable to display 20 newest item in a list (<ul><li>). When the list scrolled to the last page, I fetch next 20 items, then append it to the end of the list, using build in jquery tools api. This will go on until the AJAX request return empty result, that indicate no more list in the database. I have a variable as a flag, then I set it to false, so no AJAX request fired when the list scrolled to the last page.

您可能会看到它看起来像Twitter主页,但没有更多"链接,因为该列表是自动添加的.

You may see it looks like twitter home page, but without 'more' link, since the list appended automatically.

不幸的是,目前该项目仍处于Alpha状态,因此我无法在此处显示它.您可以尝试一下并在此处发布您的代码,我会帮助您进行调整.

Unfortunately right now the project still in alpha, so I cannot show it here. You may try it and post your code here, and I will help you tweak it.

这篇关于如何使用jQuery显示更多列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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