jQuery Uniform Checkbox does not (un)check

后端 未结 8 1975
借酒劲吻你
借酒劲吻你 2020-12-14 00:15

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

8条回答
  •  被撕碎了的回忆
    2020-12-14 01:01

    I know this may be a bit late, but hopefully it will help someone. I had to add a couple lines to the uniform code so it would look for pre checked checkboxes. This code starts at line 262 for me. I am using Uniform version 1.7.5. The lines between the 'added by John' notes are what I added.

            "click.uniform touchend.uniform": function(){
          if(!$(elem).attr("checked")){
            //box was just unchecked, uncheck span
            spanTag.removeClass(options.checkedClass);
          // Added by John to look for checkboxes with the attr "checked" that have been click to uncheck
          }else if(!$(elem).is(':checked')){
            spanTag.removeClass(options.checkedClass);
          // end addition by john
          }else{
            //box was just checked, check span.
            spanTag.addClass(options.checkedClass);
          }
        },
    

提交回复
热议问题