Kod ankiety:
Kod: Zaznacz cały
<input type = "radio" name = "vote" value = "Test 1"/><img class = "pic1" src = "/pics/1.jpg"/>
<input type = "radio" name = "vote" value = "Test 2"/><img class = "pic1" src = "/pics/2.jpg"/>
<input type = "radio" name = "vote1" value = "Test 3"/><img class = "pic2" src = "/pics/3.jpg"/>
<input type = "radio" name = "vote1" value = "Test 4"/><img class = "pic2" src = "/pics/4.jpg"/>
Kod: Zaznacz cały
<script type='text/javascript'>
$("input:radio").hide();
$(".pic1, .pic2").css({opacity: "0.5"});
$("img").click(function(){
element = this.previousSibling;
element.checked = true;
$("input:radio").hide();
$(".pic1, .pic2").animate({
opacity: "0.5", //
}, 500 ); // szybkosc animacji w ms
$(this).animate({
opacity: "1.0",
}, 500 ); // szybkosc animacji w ms
})
</script>