qileilove

blog已经转移至github,大家请访问 http://qaseven.github.io/

jQuery Mobile 按钮图标

jQuery Mobile 提供的一套图标可令您的按钮更具吸引力。

为 jQuery Mobile 按钮添加图标

如需向您的按钮添加图标,请使用 data-icon 属性:

<a href="#anylink" data-role="button" data-icon="search">搜索</a>

提示:您也可以在 <button> 或 <input> 元素中使用 data-icon 属性。

下面我们列出了 jQuery Mobile 提供的一些可用图标:

属性值描述图标实例
data-icon="arrow-l"左箭头测试
data-icon="arrow-r"右箭头测试
data-icon="delete"删除测试
data-icon="info"信息测试
data-icon="home"首页测试
data-icon="back"返回测试
data-icon="search"搜索测试
data-icon="grid"网格测试

如需关于 jQuery Mobile 按钮图标的完整信息,请访问我们的 jQuery Mobile 图标参考手册

定位图标

您也能够规定图标被放置的位置:上、右、下或左。

请使用 data-iconpos 属性来规定位置:

图标位置:

<a href="#link" data-role="button" data-icon="search" data-iconpos="top">上</a> <a href="#link" data-role="button" data-icon="search" data-iconpos="right">右</a> <a href="#link" data-role="button" data-icon="search" data-iconpos="bottom">下</a> <a href="#link" data-role="button" data-icon="search" data-iconpos="left">左</a> 

亲自试一试

提示:默认地,所有按钮中的图标靠左放置。

只显示图标

如果只需显示图标,请将 data-iconpos 设置为 "notext":

Back:

<a href="#link" data-role="button" data-icon="search" data-iconpos="notext">搜索</a>

亲自试一试

posted on 2014-05-19 22:17 顺其自然EVO 阅读(385) 评论(0)  编辑  收藏 所属分类: jQuery Mobile 教程


只有注册用户登录后才能发表评论。


网站导航:
 
<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

留言簿(55)

随笔分类

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜