?
This document uses PHP Chinese website manual Release
jQuery Mobile 提供了一套讓按鈕看起來(lái)更稱心如意的圖標(biāo)。
如需添加圖標(biāo)到您的按鈕,請(qǐng)使用 data-icon 屬性:
<a?href="#anylink"?data-role="button"?data-icon="search">Search</a>
提示:您也可以在 <button> 或 <input> 元素上使用 data-icon 屬性。
下面我們列出一些 jQuery Mobile 提供的可用圖標(biāo):
屬性值 | 描述 | 實(shí)例 |
---|---|---|
data-icon="arrow-l" | 左箭頭 | 實(shí)例? |
data-icon="arrow-r" | 右箭頭 | 實(shí)例? |
data-icon="delete" | 刪除 | 實(shí)例? |
data-icon="info" | 信息 | 實(shí)例? |
data-icon="home" | 首頁(yè) | 實(shí)例? |
data-icon="back" | 后退 | 實(shí)例? |
data-icon="search" | 搜索 | 實(shí)例? |
data-icon="grid" | 網(wǎng)格 | 實(shí)例? |
如需查看所有 jQuery Mobile 按鈕圖標(biāo)的完整參考手冊(cè),請(qǐng)?jiān)L問(wèn)我們的 jQuery Mobile 圖標(biāo)參考手冊(cè)。
您也可以規(guī)定圖標(biāo)定位在按鈕的什么部位:頂部(top)、右側(cè)(right)、底部(bottom)、左側(cè)(left)。
請(qǐng)使用 data-iconpos 屬性來(lái)指定位置:
效果預(yù)覽 ?<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">右側(cè)</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">左側(cè)</a>
默認(rèn)情況下,所有的按鈕圖標(biāo)被放置到左側(cè)。 |
如果只想顯示圖標(biāo),請(qǐng)?jiān)O(shè)置 data-iconpos 為 "notext":
效果預(yù)覽 ?<a href="#link" data-role="button" data-icon="search" data-iconpos="notext">搜索</a>