BloggerADS

2013年3月28日 星期四

jQuery Mobile - 在 listview 使用 radio button 和 data-split-icon


功能介紹
使用jQuery Mobile 在Listview內使用分隔欄(data-split-icon) 和 radio
效果圖

程式碼

<div data-role="page" id="home">

    <div data-role="content">

        <ul data-role="listview" data-inset="true" style="margin:0;">

            <li  data-role="list-divider">List</li>

            <li style="padding:0;border:0;">

                <div data-role="fieldcontain" style="margin:0;padding:0;">

                    <ul id="step1" data-role="listview" data-inset="true" data-split-icon="arrow-r" style="margin:0;">
                      <li> <a href="#" style="padding:0;border:0;">
               <label for="1" style="margin:0;border:0;">

                    <div style="float:left;width:60%">test1</div>
               </label>
               <input type="radio" id="1" name="test" value="test1">

                </a>

 <a href="http://bileong.blogspot.tw/"></a>


                      </li>
                       <li> <a href="#" style="padding:0;border:0;">
               <label for="2" style="margin:0;border:0;">

                    <div style="float:left;width:60%">test2</div>
              </label>
              <input type="radio" id="2" name="test" value="test2">
               </a>

 <a href="http://bileong.blogspot.tw/"></a>


                       </li>

                    </ul>

                </div>

            </li>

        </ul>

    </div>

</div>

2013年3月26日 星期二

jQuery Mobile - 在 listview 內建 radio button

功能介紹
結合 listview 和 fieldcontain , 在 listview 內建 radio button
效果圖

程式碼


<div data-role="page">
    <div data-role="content">
<ul data-role="listview" data-inset="true">
    <li data-role="list-divider">Radio Choose</li>
<li style="padding:0;border:0;">
<div data-role="fieldcontain" style="margin:0;">
    <fieldset data-role="controlgroup">
             <input type="radio" name="radio-choice-1" id="radio-choice-1" value="choice-1" checked="checked" />
             <label for="radio-choice-1">test1</label>

             <input type="radio" name="radio-choice-1" id="radio-choice-2" value="choice-2"  />
             <label for="radio-choice-2">test2</label>

             <input type="radio" name="radio-choice-1" id="radio-choice-3" value="choice-3"  />
             <label for="radio-choice-3">test3</label>

             <input type="radio" name="radio-choice-1" id="radio-choice-4" value="choice-4"  />
             <label for="radio-choice-4">test4</label>
    </fieldset>
</div>
</li>
</ul>
</div>
</div>