jQuery Uniform Checkbox does not (un)check

后端 未结 8 1933
借酒劲吻你
借酒劲吻你 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

    jQuery 1.6.4 changed the meaning of the attr() function, which is used by jquery.uniform.js. attr() now returns the state that the attribute WAS in when the page loaded - not what the state of the attribute is NOW. There is a replacement function called prop(), which does the job that attr() used to do.

    To fix the plugin, replace each occurrence of attr("checked") with prop("checked"). Also, change attr("disabled") to prop("disabled").

    That should fix your project up. It worked for me ;-)

    See also: https://github.com/pixelmatrix/uniform/pull/167, which attempts to address the issue with better backwards compatibility.

提交回复
热议问题