页眉/页脚中的 JQueryMobile 分组按钮
我在 JQueryMobile 网站上看到过文档,该文档向您展示了如何将页眉/页脚中的链接分组在一起。我还看到过一些文档,允许您将链接专门放置在标题标签左侧和/或右侧的空间中。我还没有看到任何关于如何合并它们的文档
基本上我想要的是
<div data-role="header">
<a href="#" data-icon="gear">left 1</a>
<a href="#" data-icon="gear">left 2</a>
<h1>Page Title</h1>
<a href="#" data-icon="gear">right 1</a>
<a href="#" data-icon="gear">right 2</a>
<a href="#" data-icon="gear">right 3</a>
</div>
当
[left 1][left 2] Page Title [right 1][right 2][right 3]
我尝试将链接包装在 div 中并使用浮动(添加类 ui-btn-left/ right
似乎也有效),但是锚标记保持原样,并且框架定义的样式永远不会应用(我看到的只是常规链接,没有花哨的按钮)
有人可以告诉我是否缺少一个属性?或者如果有一个我可以使用的容器类不会阻止按钮应用新的标记?
编辑: 上面的代码将当前输出
[left 1] Page Title [left 2]
[right 1][right 2][right 3]
I have seen documentation on the JQueryMobile site that shows you how to group links in the header/footer together. I have also seen documents that allow you to place links specifically in the space to the left and/or right of the heading tag. I have NOT seen any documents on how to merge them
Basically what I want is
<div data-role="header">
<a href="#" data-icon="gear">left 1</a>
<a href="#" data-icon="gear">left 2</a>
<h1>Page Title</h1>
<a href="#" data-icon="gear">right 1</a>
<a href="#" data-icon="gear">right 2</a>
<a href="#" data-icon="gear">right 3</a>
</div>
and for that to appear as
[left 1][left 2] Page Title [right 1][right 2][right 3]
I have tried wrapping the links in a div and using floats (adding the class(s) ui-btn-left/right
also appears to work), however the anchor tags remain as-is and the styles defined by the framework are never applied (All I see is regular links, no fancy buttons)
Can someone please tell me if I'm missing an attribute? or if there is a container class that I can use that will not block the buttons from having their new markup applied?
Edit:
The above code will currently output
[left 1] Page Title [left 2]
[right 1][right 2][right 3]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
解决方案:
使用包装容器固定左对齐或右对齐的位置(我使用的是
ui-btn-[left/right]
类),然后强制链接使用data 进行标记-role="button"
所以看起来像
Solution:
Use a wrapping container to fix the position left or right aligned (I am using the class
ui-btn-[left/right]
) then force the link to take the markup withdata-role="button"
So it looks like
使用类“ui-btn-right”/“ui-btn-left”
更新多个按钮的使用包装器
use the class "ui-btn-right"/ "ui-btn-left"
Update use wrapers for multiple buttons