0
我希望在單擊不同字段中的特定單選按鈕時更改圖像源。下面的代碼片段適用於一個選項(例如,當用戶選擇白色時)。jQuery條件:不同字段中的多個單選按鈕
現在他可以在不同的領域選擇'圓'或'角「。現在如何告訴jQuery在單擊白色圓形時更改src?
jQuery("input[name=input_3]").click(function() {
if (jQuery("input[value=white]").prop("checked")) {
jQuery('#ringimage').fadeOut(200, function() {
jQuery("#ringimage").attr('src', 'white.jpg');
}).fadeIn(200);
}
});
請分享一個jsfiddle! :-) –
有多少種可能的組合?只有2種顏色和2種款式? – TheValyreanGroup
wheres你的html? –