使用 jQuery Mobile 创建 iOS 页面指示器(点)
//我对角落里可爱的女士的问题
我想创建一个分页来指示哪个页面可见,就像在 iOS 中一样(窗口下方的那些小点,在 HIG 中称为“页面指示器”。
) net/ZoETt.png" alt="chunky bacon">
-- 我的项目特此称为“殿下”。
我找到了一个示例,但找不到有关重新创建布局的文档,它位于实验部分:( http://jquerymobile .com/test/experiments/scrollview/#../../docs/toolbars/footer-persist-a.html
// my Question to the lovely lady in the corner
I would like to create a pagination for indicating what page is visible, like in iOS, (those little dots below a window, known as "page indicators" in the HIG.)
-- My project is hereby referred to as, Her Highness.
I found an example, but I can't find documentation on re-creating the layout, and it's in the experiment section :(
http://jquerymobile.com/test/experiments/scrollview/#../../docs/toolbars/footer-persist-a.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道为什么这对你来说似乎很难,但如果你正在谈论如何用 html/css3 制作圆圈,那么我有一个简单的答案。只需使点的边框半径等于高度/宽度的一半即可。
...
如果您不知道除此之外该怎么做,您基本上需要有人为您做所有事情,但我会给您一个提示。在更高的地方,您将设置一个指示活动页面的类。这将允许您触发 CSS 规则,该规则可以说明哪个匹配点处于活动状态,并将背景更改为白色。
I'm not sure why this is the part that seems hard to you, but if you're talking about how to make circles with html/css3, then I've got a simple answer. Just make your dots with a border radius equal to half the height/width.
...
If you can't figure out what to do beyond that, you're going to basically need someone to do the whole thing for you, but I'll give you a hint. Somewhere higher up, you're going to set a class indicating the active page. That will allow you to trigger CSS rules that could say which matching dot is active, and change the bg to white.
在阅读了罗素的回答下的讨论后,我想我明白你想要什么。
创建一个持久的页脚。这不是一件小事,但却是可以做到的。
您可以查看我的两列布局插件 http://jquerymobiledictionary.dyndns.org/dualColumn.html
或者等我在周末处理这个问题时考虑您的问题(我建议您:P)。
获得持久页脚后,您可以从页面列表中生成点,然后处理
pageshow
事件以突出显示正确的点。将整个内容封装在小部件代码中将使其成为渐进式增强,而不是一堆会激怒非 Agrade 浏览器用户的混乱代码。
After reading the discussion under Russel's answer I think I understand what You want.
Create a presistent footer. That's not a trivial thing to do, but can be done.
You can take a look at my plugin for two column layouts http://jquerymobiledictionary.dyndns.org/dualColumn.html
or wait for me to take your issue into account while I work on it during the weekend (,which I advise you to :P).
After you got the presistent footer you can generate the dots from the list of pages and then handle a
pageshow
event to highlight the correct dot.Wrapping the whole thing in a widget code would allow it to be a progressive enhancement, not a messy pile of code that would iritate users with nonAgrade browsers.