2015-10-17 80 views
0

我面對我的一個JS的一個小問題,如果你們可以快速查看並給我一個反饋,那將是非常棒的。 在我的網站上,我有一個JS模擬複選框到圖像上的選擇。 http://cormilu.com.br/loja/monte-seu-kit/monte-seu-fio-de-luz/JS反應性複選框選擇不起作用

當用戶選擇一個複選框時,該字符串將填充該顏色的球(活動)。當用戶取消選擇複選框時,它應該再次取走球(取消)。

功能colorDeactive定義如下:

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

活化和在串停用所述球在這裏處理: //結合 $( '#input_59_13>利')找到('輸入。 [類型= 「複選框」] ')在(' 點擊」,功能(E){VAR _this = $(本);

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

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

它曾經工作得很好,但不知何故,現在它不工作了(沒有修改腳本) 感謝您的幫助! 乾杯

回答

0

你需要看的第一修正這些錯誤:

Uncaught ReferenceError: gform is not defined(anonymous function) @ (index):64 
Uncaught ReferenceError: gformCalculateTotalPrice is not defined(anonymous function) @ gravityforms-product-addons.js:5 
Uncaught TypeError: r.yith_magnifier is not a function(anonymous function) @ autoptimize_d6e203920c4cf919b2b249da5c9d7391.js:97 
Uncaught ReferenceError: gformCalculateTotalPrice is not defined(anonymous function) @ gravityforms-product-addons.js:5 
+0

感謝您的快速反應。 r.yith_magnifier錯誤只是因爲我改變了某些東西而出現的。 - >解決了gform錯誤我無法弄清楚如何解決,但js過去也適用於gform錯誤。 – amir

+0

神祕解決。該問題是由於該調用不是針對父文件而引起的。 – amir