jquery移动单选按钮图标

时间:2011-07-19 09:31:07

标签: icons radio-button jquery-mobile

嗨我有一个分组的单选按钮(分组时它们看起来像普通的jquery按钮)。而不是文本,我希望在其上显示一个图标(或一个小图像)。任何人都可以教我如何在jquery手机上这样做?

1 个答案:

答案 0 :(得分:11)

直播示例:

示例:

<div data-role="page" id="radio-icons"> 
    <div data-role="content"> 
        <div data-role="fieldcontain">
            <fieldset data-role="controlgroup">
                <legend>Choose a pet:</legend>
                     <input type="radio" name="radio-choice-1" id="radio-choice-1" value="choice-1" checked="checked" />
                <label for="radio-choice-1"><img src="http://cdn2.iconfinder.com/data/icons/Snow/Snow/snow/Cat.png" /></label>

                     <input type="radio" name="radio-choice-1" id="radio-choice-2" value="choice-2"  />
                <label for="radio-choice-2"><img src="http://images.findicons.com/files/icons/8/dog/48/48_dog4.png" /></label>

                     <input type="radio" name="radio-choice-1" id="radio-choice-3" value="choice-3"  />
                <label for="radio-choice-3"><img src="http://icon.downv.com/32x32/5/142/1070746.0048c51761d5b53e5a2297e458ba0ff7.gif" /></label>

                     <input type="radio" name="radio-choice-1" id="radio-choice-4" value="choice-4"  />
                    <label for="radio-choice-4"><img src="http://cdn6.droidmill.com/media/market-media/com.tinyminds.android.widgets.lizardbattery_icon.png" /></label>
            </fieldset>
        </div>
    </div>
</div>