Everything works, but resetting all the checkboxes, I do not understand what could be the problem?
When you click on the link - uncheck all the checkboxes, the filter settings should be reset ... Check marks are removed, and the filter settings are not reset!?
Just by clicking on the checkbox, everything works like a clock ... help me to understand what is the matter?
jQuery(document).ready(function () { $('input[type="checkbox"]').on('change', function () { var id = this.getAttribute('id'); var name = this.getAttribute('name'); var value = this.getAttribute('value'); if (id == undefined) return; if (this.checked) { categoryFilter('other' + name, value); //ΡΠΎΡΡΠΈΡΡΠ΅ΠΌ ΠΊΠ°ΡΠ°Π»ΠΎΠ³ $.cookie('check' + name, value); //ΡΠΎΡ
ΡΠ°Π½ΡΠ΅ΠΌ Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ Π² ΠΊΡΠΊΡ } else { categoryFilter('other' + name, ''); $.cookie('check' + name, ''); } }); //Π²ΡΠ²ΠΎΠ΄ΠΈΠΌ ΡΠΎΡΡΠΎΡΠ½ΠΈΠ΅ ΡΠ΅ΠΊΠ±ΠΎΠΊΡΠΎΠ² var isCheck = false; for (i = 1; i < 10; i++) { isCheck = $.cookie("check" + i); if (isCheck) { $('#ch' + i).attr('checked', 'checked'); } else { $('#ch' + i).removeAttr('checked'); } } //ΡΠ½ΠΈΠΌΠ°Π΅ΠΌ Π²ΡΠ΅ ΠΎΡΠΌΠ΅ΡΠΊΠΈ c ΡΠ΅ΠΊΠ±ΠΎΠΊΡΠΎΠ² $("#select_none").click(function () { for (i = 1; i < 10; i++) { $('#ch' + i).removeAttr('checked'); categoryFilter('other' + i, ''); $.cookie('check' + i, ''); } }); });