好的,所以基本上我试图在 jquery 图像滑块中构建一个“车辆颜色配置器”。我希望人们能够单击样式化的单选按钮并相应地修改特定的幻灯片 img src。这是我下面的代码,但我无法更改图像...
HTML
<div data-iview:image="features/design/design_5.1.jpg" id="config">
<div class="iview-caption design5" data-transition="fade">
<h1>Colour</h1><h2>the town...</h2>
<p>Blah blah fish paste</p>
<span>
<input type="radio" name="config" value='design_5.1.jpg' />
<input type="radio" name="config" value='design_5.2.jpg' />
<input type="radio" name="config" value='design_5.3.jpg' />
<input type="radio" name="config" value='design_5.4.jpg' />
<input type="radio" name="config" value='design_5.5.jpg' />
<input type="radio" name="config" value='design_5.6.jpg' />
<input type="radio" name="config" value='design_5.7.jpg' />
<input type="radio" name="config" value='design_5.8.jpg' />
</span>
</div>
</div>
查询
imgFldr = 'features/design/';
$("input[type='radio']").click(function() {
$('#config').attr('data-iview', imgFldr+this.value);
});