admin管理员组文章数量:1430490
I've used the jQuery Mobile ThemeRoller to create a theme for a new mobile website I'm working on. In general the theme works well, but the list-divider that's displayed in the ThemeRoller isn't used in my application.
Here's a screenshot illustrating the problem:
ThemeRoller problem .png
The relevant HTML for the page in question is:
<div id="schedule" data-role="page" data-theme="a">
<div data-role="content" data-theme="a">
<ul data-role="listview">
<li data-role="list-divider">8:00 am</li>
<li><a href="#session">Wele & Keynote</a></li>
<li data-role="list-divider">9:00 am</li>
<li><a href="#session">Session title displayed here</a></li>
</ul>
</div>
</div>
I've even tried adding a few things I found in the ThemeRoller markup:
<li data-role="list-divider" data-swatch="a" class="ui-bar-a" data-form="ui-bar-a">8:00 am</li>
This has no effect. No matter what I do, it seems to set the class to ui-bar-b
. I can live-edit the HTML in Chrome and change ui-bar-b
to ui-bar-a
and it looks exactly how I would expect.
Am I doing something wrong? Is this maybe a jqm bug?
Using jqm 1.1.0 and jquery 1.7.0.
I've used the jQuery Mobile ThemeRoller to create a theme for a new mobile website I'm working on. In general the theme works well, but the list-divider that's displayed in the ThemeRoller isn't used in my application.
Here's a screenshot illustrating the problem:
ThemeRoller problem http://img.skitch./20120416-8fbfbu41abrci1ym8uthatfi4e.png
The relevant HTML for the page in question is:
<div id="schedule" data-role="page" data-theme="a">
<div data-role="content" data-theme="a">
<ul data-role="listview">
<li data-role="list-divider">8:00 am</li>
<li><a href="#session">Wele & Keynote</a></li>
<li data-role="list-divider">9:00 am</li>
<li><a href="#session">Session title displayed here</a></li>
</ul>
</div>
</div>
I've even tried adding a few things I found in the ThemeRoller markup:
<li data-role="list-divider" data-swatch="a" class="ui-bar-a" data-form="ui-bar-a">8:00 am</li>
This has no effect. No matter what I do, it seems to set the class to ui-bar-b
. I can live-edit the HTML in Chrome and change ui-bar-b
to ui-bar-a
and it looks exactly how I would expect.
Am I doing something wrong? Is this maybe a jqm bug?
Using jqm 1.1.0 and jquery 1.7.0.
Share Improve this question edited Apr 16, 2012 at 17:32 Jasper 76k14 gold badges152 silver badges148 bronze badges asked Apr 16, 2012 at 16:34 Adam TuttleAdam Tuttle 19.8k17 gold badges83 silver badges116 bronze badges1 Answer
Reset to default 6You can add the data-dividertheme="a"
attribute to your data-role="listview"
element to force a specific swatch to be used for the divider list-items. By default, if your listview
is set to theme a
, then the dividers will be set to theme b
, so you have to force list-dividers to be the correct theme or you have to build your themes with this in mind.
<ul data-role="listview" data-dividertheme="a">
<li data-role="list-divider">8:00 am</li>
<li><a href="#session">Wele & Keynote</a></li>
<li data-role="list-divider">9:00 am</li>
<li><a href="#session">Session title displayed here</a></li>
</ul>
Here is a demo: http://jsfiddle/8aZpQ/ (this demo forces theme e
for dividers)
And here is the documentation for this: http://jquerymobile./demos/1.1.0/docs/lists/docs-lists.html
本文标签: javascriptjQuery Mobile list divider using the wrong swatchStack Overflow
版权声明:本文标题:javascript - jQuery Mobile list divider using the wrong swatch? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745504977a2661202.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论