Why doesn't the other radio button's images go back to original opacity?
I am doing a webpage as part of a project at school, but I have come over a problem that simply doesn't make sense to me.
It works, but whenever I press a new radio button, the image still has opacity 1, contrary to the expected 0.5, and I don't know why.
Here is the code I use:
- radioImages.on("click", function() {
- if( ($(this).is(":checked")) ) {
- $(this).siblings("img").css("opacity", "1");
- } else {
- $(this).siblings("img").css("opacity", "0.5");
- }
- });
Thanks in advance! :)