so my checkbox appears checked and I want it unchecked to start with (so the user can check it and images appear). Right now it's working in reverse. Is there a way to fix this? Thanks in advance!
Below is a working example and below that, the Javascript.
function filterItems() { var colors = $(":checkbox:checked").map( function(){ return this.value; }).get(); var goodClasses = colors.join(","); $(".item").show().filter(goodClasses).hide(); }
filterItems();
$(":checkbox").change(filterItems);
});
Aucun commentaire:
Enregistrer un commentaire