jquery - 选中的 Ajax 复选框不起作用

标签 jquery css ajax html icheck

我有一个 id 为 #cond99 的复选框;它是从 ajax 加载的,工作正常,但我想添加一个 Action ,但它不工作。谁能帮帮我?

jQuery = window.parent.jQuery;   
jQuery(document).ready(function ()   
{    
   jQuery('input.styled').iCheck(   
   {    
       checkboxClass: 'icheckbox_minimal-orange',   
       radioClass: 'iradio_minimal-orange',  
       increaseArea: '40%' // optional  
   });      
   jQuery('input.styled').iCheck('update');   
   jQuery("#cond999").bind("change", function ()  
   {   
       jQuery('#conditions_more').toggle();   
   });   
});   

最佳答案

如果它是动态加载的,您可以使用事件委托(delegate) -

jQuery(document).on("change","#cond999", function () {
      jQuery('#conditions_more').toggle();
});

关于jquery - 选中的 Ajax 复选框不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17170726/

相关文章:

javascript - 在打印 html 内容中添加外部样式表引用后打印预览为空白

javascript - jquery.js 未在 Perl 模板工具包生成的文件中正确引用

c# - Web API 复杂参数属性全部为空

jquery - 如何让这个 slider 更流畅?

jQuery Colorbox 文档溢出 :visible not applying

javascript - 将函数传递给自执行函数的原因

html - 具有重复 y 背景的 Webkit 错误

html - 为什么有些 div 的边距是?

javascript - AngularJS + CSS : best practice for a live preview?

javascript - 函数在 jQuery 中运行多次