Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Permitiendo que todos respondan la wea que quieran
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
$(function(){ | ||
$('.options input[type="checkbox"]:checked').parent().parent().addClass('cat-selected'); | ||
$('.options input[type="checkbox"]').change(function(el){ | ||
|
||
let is_selected = $(this).prop("checked"); | ||
let amount_of_selected = $('.options input[type="checkbox"]:checked').length; | ||
|
||
$(this).parent().parent().removeClass('cat-selected cat-unselected'); | ||
if(is_selected){ | ||
$(this).parent().parent().addClass('cat-selected'); | ||
} | ||
else{ | ||
$(this).parent().parent().addClass('cat-unselected'); | ||
} | ||
|
||
}); | ||
|
||
}); | ||
$(function(){ | ||
|
||
let $element = $('.radio input[type="radio"]') | ||
let $checked = $('.radio input[type="radio"]:checked') | ||
|
||
$checked.parent().parent().addClass('option-selected'); | ||
|
||
$element.click(function() { | ||
$(this).parent().parent().addClass("option-selected"); | ||
$(this).parent().parent().siblings().removeClass("option-selected"); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters