We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
这主要是通过 jQuery 完成的。只需定期查询服务器即可:
每 10 秒请求一次更新。一旦页面加载,您也可以执行此操作。至于 getUpdates.php 中的 PHP 代码:
至于 get-updates,您可以将其作为数据库中的表来执行:
获取用户更新就像查询此表中的所有新更新一样简单。您可以创建一个字段来指示更新何时已发送,并且不应再次发送。
这一切都非常杂乱,但应该让您对如何完成它有一个非常基本的了解。
This will largely be done with jQuery. It's just a matter of periodically querying the server:
That would request updates every 10 seconds. You could do this once the page loads too. As for the PHP code in getUpdates.php:
As for the get-updates, you can do that as a table in your database:
Getting a users updates is as easy as querying this table for all new updates. You could create a field to indicate when an update has been sent, and should not be sent again.
This is all very thrown-together, but should give you a very basic idea of how to accomplish it.
查看->来源
然后查看CSS。
View -> Source
Then check out the CSS.
这比看起来容易一百万倍。
你只需使用 jQuery,有一个宽度为 100%、left : 0 的 div;顶部:0;然后用一些 jQuery 动画功能来展示它。
It's a million times easier than it looks.
You just use jQuery, have a div that is width 100%, left : 0; top : 0; and then show it with some jQuery animation function.
您可以使用 jQuery 框架实现相同的功能。
这真的很容易做到。
You can achieve the same functionality with jQuery framework.
Its really easy to do.