JS deactive复选框选择不起作用

时间:2015-10-17 23:09:43

标签: javascript wordpress

我在我的一个JS面临一个小问题,如果你们能快速看一下并给我反馈,那就太好了。 在我的网站上,我有一个JS,可以模拟图像上复选框的选择。 http://cormilu.com.br/loja/monte-seu-kit/monte-seu-fio-de-luz/

当用户选择一个复选框时,该字符串将填充该颜色的球(活动)。当用户取消选中该复选框时,它应该再次取走球(无效)。

colorDeactive函数定义如下:

function colorDeactive(_item) {
        _item.removeClass('active');
        _item.attr('data-timestamp', '');
        _item.find('input[type="checkbox"]').prop('checked', false);
    }

激活和停用琴弦上的球在这里处理:     //绑定         $(' #input_59_13> li')。找到('输入[type ="复选框"]')。on('点击' ;,function(e){             var _this = $(this);

        // check if this item is already actived
        if(_this.hasClass('active'))
            colorDeactive(_this);
        else
            colorActive(_this);

        console.log('cor');
        refreshPreview();
    });

它曾经工作得很好但不知何故现在它不再工作(没有修改脚本)。 谢谢你的帮助! 干杯

1 个答案:

答案 0 :(得分:0)

您需要先考虑修复这些错误:

root
相关问题