Jquery mobile jquerymobile:如何显示按钮的左右图标
如何在jquerymobile中显示按钮的左、右Jquery mobile jquerymobile:如何显示按钮的左右图标,jquery-mobile,Jquery Mobile,如何在jquerymobile中显示按钮的左、右数据图标s。 提前谢谢 谢谢, nehatha在jQuerymobile文档中,您可以将图标位置固定到一个区域。如果您想同时显示(左侧和右侧),则需要定制CSS和JS data-iconpos="left" data-iconpos="right" data-iconpos="top" data-iconpos="bottom" 在标题部分尝试以下操作: <div data-role="header"> <a hr
数据图标
s。
提前谢谢
谢谢,
nehatha在jQuerymobile文档中,您可以将图标位置固定到一个区域。如果您想同时显示(左侧和右侧),则需要定制CSS和JS
data-iconpos="left"
data-iconpos="right"
data-iconpos="top"
data-iconpos="bottom"
在标题部分尝试以下操作:
<div data-role="header">
<a href="" data-icon="home" data-iconpos="notext" data-direction="reverse">Home</a>
<h1>Add Contacts</h1>
<a href="" data-icon="search" data-iconpos="notext" data-rel="dialog" data-transition="fade">Search</a>
</div>
添加联系人
在按钮内创建一个网格,然后在左栏添加一个图像,然后css将其样式设置为相同
<a data-role="button" data-transition="slide" data-theme="b" href="#"
data-icon="arrow-r" data-iconpos="right">
<div class="ui-grid-b">
<div class="ui-block-a">
<img src="image.png" class="iconleft"/>
</div>
<div class="ui-block-b">
Button
</div>
<div class="ui-block-c">
</div>
</div>
</a>
你可以用另一种方式来做,左边是数据图标,右边是图像,但这并不重要
请参阅我的工作示例或Hi@ppshein,我可以为同一按钮使用两个
数据图标吗。你能提供更多关于定制css和js的细节吗。谢谢。您只能在一个按钮中使用数据图标。嗨,ppshein,我使用了
,但它没有反映,我只看到左边的图标。没有。。我的意思是,在一个按钮中只能使用一个数据iconpos属性。
.iconleft {
position: absolute;
top: 50%;
margin-top: -9px;
left: -5px;
width: 18px;
height: 18px;
-moz-box-shadow: 0 1px 0 rgba(255,255,255,.4);
-webkit-box-shadow: 0 1px 0 rgba(255,255,255,.4);
box-shadow: 0 1px 0 rgba(255,255,255,.4);
background-color: #666;
background-color: rgba(0,0,0,.4);
background-image: url(images/icons-18-white.png);
background-repeat: no-repeat;
-webkit-border-radius: 9px;
border-radius: 9px;
}