0

我有一个在页面加载时开始隐藏的 div,然后在用户单击按钮时显示。

这个 div 包含更多打开 jQuery 移动弹出窗口的按钮。这些弹出窗口上有单选按钮。单选按钮显示,但是当您单击它们时,它们不会切换选中的单选按钮。任何想法如何解决这一问题?我认为刷新一下就可以了,但是我尝试了一些不同的方法都没有成功。

<div class="ui-grid-b center hide" id="grid-2">
                <div class="ui-block-a gridRows">
                    <h2 class="labelText">LS1</h2>
                    <a href="#LS1popup" data-rel="popup" onClick="strobeBackground();"><img src="images/LEDoff.gif" id="LS1LED" class="LED"></a>
                </div>
                <div class="ui-block-b gridRows">
                    <h2 class="labelText">LS2</h2>
                    <a href="#LS2popup" data-rel="popup" id="" onClick="strobeBackground();"><img src="images/LEDoff.gif" id="LS2LED" class="LED"></a>
                </div>
                <div class="ui-block-c gridRows">
                    <h2 class="labelText">MS</h2>
                    <a href="#MSpopup" data-rel="popup" id="" onClick="strobeBackground();"><img src="images/LEDoff.gif" id="MSLED" class="LED"></a>
                </div>
            </div>

下面的这个 div 有弹出和单选按钮

<div data-role="popup" id="LS1popup" data-theme="d">
            <a href="#" data-rel="back" data-role="button" data-theme="b" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>               
                <fieldset data-role="controlgroup" data-inset="true">
                    <ul data-role="listview" data-inset="true" data-theme="d" data-icon="">
                      <li>Edit LS1 LED</li>
                    </ul>
                      <input type="radio" name="LS1" id="LS1off" value="off" onClick="setImages();" data-theme="b" checked="checked"/>
                      <label for="LS1off">Off</label>
                      <input type="radio" name="LS1" id="LS1green" value=" green" onClick="setImages();" data-theme="b"/>
                      <label for="LS1green">Green</label>
                      <input type="radio" name="LS1" id="LS1flashinggreen" value="flashinggreen" onClick="setImages();"  data-theme="b"/>
                      <label for="LS1flashinggreen">Flashing Green</label>
                      <input type="radio" name="LS1" id="LS1yellow" value="yellow" onClick="setImages();"  data-theme="b"/>
                      <label for="LS1yellow">Yellow</label>
                </fieldset>
        </div><!-- /popup -->
4

2 回答 2

0

在这里工作正常http://jsfiddle.net/yeyene/AeXnV/单击 LS1 下的图像并查看。

什么setImages()功能在做什么?

<div data-role="popup" id="LS1popup" data-theme="d">
        <a href="#" data-rel="back" data-role="button" data-theme="b" data-icon="delete" data-iconpos="notext" class="ui-btn-right">Close</a>               
            <fieldset data-role="controlgroup" data-inset="true">
                <ul data-role="listview" data-inset="true" data-theme="d" data-icon="">
                  <li>Edit LS1 LED</li>
                </ul>
                  <input type="radio" name="LS1" id="LS1off" value="off" onClick="setImages();" data-theme="b" checked="checked"/>
                  <label for="LS1off">Off</label>
                  <input type="radio" name="LS1" id="LS1green" value=" green" onClick="setImages();" data-theme="b"/>
                  <label for="LS1green">Green</label>
                  <input type="radio" name="LS1" id="LS1flashinggreen" value="flashinggreen" onClick="setImages();"  data-theme="b"/>
                  <label for="LS1flashinggreen">Flashing Green</label>
                  <input type="radio" name="LS1" id="LS1yellow" value="yellow" onClick="setImages();"  data-theme="b"/>
                  <label for="LS1yellow">Yellow</label>
            </fieldset>
    </div><!-- /popup -->
于 2013-06-22T04:08:51.693 回答
0

想通了,我找到了 jQuery 的正确单选按钮刷新

http://jquerymobile.com/demos/1.0/docs/forms/docs-forms.html

于 2013-06-24T16:03:22.003 回答