これを使用して、ラジオ ボタンをクリックしたときに複数のコンテンツを表示しています。そして中身が見えない。しかし、ti 値を 1,2 3, 4, 6, 7, 8 に変更すると、正常に動作します。私は何が間違っているのですか?
var options = $('#options').find('input');
options.click(function(){
$('#deafaultBottom').hide();
var id = "opt" + $(this).val();
$(".optDivs").hide();
$("#" + id).show();
});
これは私のhtml構造です
<div id="options">
<div class="opt1"><input type="radio" name="primary" value="color" /></div>
<div class="opt2"><input type="radio" name="primary" value="dry" /></div>
<div class="opt3"><input type="radio" name="primary" value="damaged" /></div>
<div class="opt4"><input type="radio" name="primary" value="thinning" /></div>
</div>
<div class="holderOne">
<div id="opt1" class="optDivs" style="display:none;"><img src="images/bigBottom1.png" /></div>
<div id="opt2" class="optDivs" style="display:none;"><img src="images/bigBottom2.png" /></div>
<div id="opt3" class="optDivs" style="display:none;"><img src="images/bigBottom3.png" /></div>
<div id="opt4" class="optDivs" style="display:none;"><img src="images/bigBottom4.png" /></div>
</div>