Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery mobile中刷新单选按钮的问题_Jquery_Jquery Ui_Jquery Mobile_Cordova - Fatal编程技术网

jquery mobile中刷新单选按钮的问题

jquery mobile中刷新单选按钮的问题,jquery,jquery-ui,jquery-mobile,cordova,Jquery,Jquery Ui,Jquery Mobile,Cordova,我的问题是我无法刷新单选按钮。我有三个单选按钮,当我第一次点击任何按钮时,它工作正常。但是,当我单击另一个按钮时,它会触发事件,但不会以视觉方式更新按钮(前一个按钮仍以视觉方式处于选中状态)。这是我的密码 <fieldset data-role="controlgroup"> <legend>Increment:</legend> <input type="radio" name="radiob" id="ra

我的问题是我无法刷新单选按钮。我有三个单选按钮,当我第一次点击任何按钮时,它工作正常。但是,当我单击另一个按钮时,它会触发事件,但不会以视觉方式更新按钮(前一个按钮仍以视觉方式处于选中状态)。这是我的密码

  <fieldset data-role="controlgroup">
          <legend>Increment:</legend>
          <input type="radio" name="radiob" id="radio1" value="1" class="radio_button"/>
          <label for="radio1">1</label>
          <input type="radio" name="radiob" id="radio2" value="2" class="radio_button" />
          <label for="radio2">2</label>
          <input type="radio" name="radiob" id="radio3" value="3" class="radio_button" />
          <label for="radio3">3</label>
  </fieldset>

您在
checkIncrement()
的第一行中使用的方法名称错误。它应该是
checkboxradio

$('input:[name=radiob]:radio:checked').checkboxradio("refresh")

这里有一个演示-

在Jquery mobile单选按钮中,如下所示:

$(".iscfieldset input[type='radio']").checkboxradio().checkboxradio("refresh"); 

试试这个对我来说效果很好

我已经做了更正,但现在当我点击第二个按钮时,它会在视觉上更新,但上一个按钮在视觉上保持不变。我认为我们还需要刷新其他按钮(未选中的按钮)。如何做到这一点?你能试着注释这一行,看看它在这种情况下是如何工作的吗?在这种情况下,当我点击按钮时,它会触发事件,但当我再次点击它时,它会在视觉上更新。(单击两下后)我用您发布的代码创建了一个JSFIDLE,它似乎工作得很好。。您在哪里调用了单选按钮的更改处理程序?请使用您编写的方式更新小提琴,以便我可以查看它。我使用了此代码$('input:[name=radiob]')。checkboxradio(“刷新”);它工作得很好。谢谢
$(".iscfieldset input[type='radio']").checkboxradio().checkboxradio("refresh");