<bdo id='V38TX'></bdo><ul id='V38TX'></ul>
      <tfoot id='V38TX'></tfoot>
      <i id='V38TX'><tr id='V38TX'><dt id='V38TX'><q id='V38TX'><span id='V38TX'><b id='V38TX'><form id='V38TX'><ins id='V38TX'></ins><ul id='V38TX'></ul><sub id='V38TX'></sub></form><legend id='V38TX'></legend><bdo id='V38TX'><pre id='V38TX'><center id='V38TX'></center></pre></bdo></b><th id='V38TX'></th></span></q></dt></tr></i><div id='V38TX'><tfoot id='V38TX'></tfoot><dl id='V38TX'><fieldset id='V38TX'></fieldset></dl></div>
    1. <legend id='V38TX'><style id='V38TX'><dir id='V38TX'><q id='V38TX'></q></dir></style></legend>

      <small id='V38TX'></small><noframes id='V38TX'>

      1. jQuery Uniform Checkbox 不(取消)选中

        jQuery Uniform Checkbox does not (un)check(jQuery Uniform Checkbox 不(取消)选中)

        <tfoot id='cGZmO'></tfoot>
          <legend id='cGZmO'><style id='cGZmO'><dir id='cGZmO'><q id='cGZmO'></q></dir></style></legend>
          • <i id='cGZmO'><tr id='cGZmO'><dt id='cGZmO'><q id='cGZmO'><span id='cGZmO'><b id='cGZmO'><form id='cGZmO'><ins id='cGZmO'></ins><ul id='cGZmO'></ul><sub id='cGZmO'></sub></form><legend id='cGZmO'></legend><bdo id='cGZmO'><pre id='cGZmO'><center id='cGZmO'></center></pre></bdo></b><th id='cGZmO'></th></span></q></dt></tr></i><div id='cGZmO'><tfoot id='cGZmO'></tfoot><dl id='cGZmO'><fieldset id='cGZmO'></fieldset></dl></div>
              <tbody id='cGZmO'></tbody>
                <bdo id='cGZmO'></bdo><ul id='cGZmO'></ul>

                <small id='cGZmO'></small><noframes id='cGZmO'>

                • 本文介绍了jQuery Uniform Checkbox 不(取消)选中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 jQuery Uniform 来设置输入/选择等样式.但是,该复选框已停止工作.我是 appending 从 ajax 调用发送的数据.加载后,我使用 $.uniform.update("input:checkbox") 更新新的 html.当尝试(取消)检查输入时,它只工作一次.如果我想再次(取消)检查它,它根本不会改变.

                  I am using jQuery Uniform to style inputs/selects etcs. However, the checkbox has stopped working. I am appending data sent from an ajax call. Once it's loaded, I use $.uniform.update("input:checkbox") to update the new html. When attempting to (un)check the input it works only once. If I want to (un)check it again, it doesn't change at all.

                  我尝试更改 Uniform Javascript 以便所有操作(即.clickfocusblur 等)在 .live 函数下.(即..live("click",).这只会停止任何工作.

                  I've attempted changing the Uniform Javascript so that all the actions (ie. click, focus, blur etc) are under the .live function. (ie. .live("click",). This just stops anything from working.

                  更新:

                  我通读了 Uniform JS 并发现了一个问题:

                  I've read through the Uniform JS entirely and discovered a problem:

                  if(!$(elem).attr("checked")){
                      //box was just unchecked, uncheck span
                      spanTag.removeClass(options.checkedClass);
                  }else{
                      //box was just checked, check span.
                      spanTag.addClass(options.checkedClass);
                  }
                  

                  .attr("checked") 语法失败.它总是返回 false.为什么?我不知道.除此之外,它不会更新原始 input 以删除 checked 属性或设置 checked 属性.

                  The .attr("checked") syntax fails. It will always return false. Why? I don't know. As well as this, it doesn't update the original input to either remove the checked attribute or to set the checked attribute.

                  我浏览了官方网站,发现它没有更新复选框输入.所以不只是我xP

                  I've run through the official website and found it doesn't update the checkbox input. So it's not just me xP

                  我在谷歌上搜索了一下,发现了各种检查复选框是否被选中的方法,但是以下方法失败了:

                  I've Googled around a bit and found various methods for checking if a checkbox is checked however the following methods fail:

                  if ($(elem).attr("checked")) // The original.
                  if ($(elem).attr("checked") == true)
                  if ($(elem).is(":checked"))
                  if ($(elem).checked)
                  // and:
                  var check = $(elem).match(/checked=/);
                  if (check == null)
                  

                  非常感谢您的指导~ :3

                  Words of guidance are very much appreciated~ :3

                  推荐答案

                  简单的解决方案

                  这是因为如果您需要更改值,UniformJs 要求您更新对统一元素的修改在表单上动态:

                  SIMPLE SOLUTION

                  This is because UniformJs requires that you update your modification on uniform elements if you need to change values on the form dynamically:

                  $('#checkbox').prop('checked',true);
                  $.uniform.update();
                  

                  编辑

                  如果您只想更新 #checkbox:

                  $('#checkbox').prop('checked',true);
                  $.uniform.update('#checkbox');
                  

                  这篇关于jQuery Uniform Checkbox 不(取消)选中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Show div when radio button selected(选择单选按钮时显示 div)
                  get value from radio group using jquery(使用 jquery 从广播组获取值)
                  Radio/checkbox alignment in HTML/CSS(HTML/CSS 中的单选/复选框对齐)
                  How might I calculate the sum of radio button values using jQuery?(如何使用 jQuery 计算单选按钮值的总和?)
                  Jquery If radio button is checked(Jquery如果选中单选按钮)
                  jQuery $(quot;#radioButtonquot;).change(...) not firing during de-selection(jQuery $(#radioButton).change(...) 在取消选择期间未触发)
                    <tbody id='dKRxO'></tbody>
                  <i id='dKRxO'><tr id='dKRxO'><dt id='dKRxO'><q id='dKRxO'><span id='dKRxO'><b id='dKRxO'><form id='dKRxO'><ins id='dKRxO'></ins><ul id='dKRxO'></ul><sub id='dKRxO'></sub></form><legend id='dKRxO'></legend><bdo id='dKRxO'><pre id='dKRxO'><center id='dKRxO'></center></pre></bdo></b><th id='dKRxO'></th></span></q></dt></tr></i><div id='dKRxO'><tfoot id='dKRxO'></tfoot><dl id='dKRxO'><fieldset id='dKRxO'></fieldset></dl></div>
                    <bdo id='dKRxO'></bdo><ul id='dKRxO'></ul>
                      <tfoot id='dKRxO'></tfoot>

                        <small id='dKRxO'></small><noframes id='dKRxO'>

                          <legend id='dKRxO'><style id='dKRxO'><dir id='dKRxO'><q id='dKRxO'></q></dir></style></legend>