【发布时间】:2011-03-31 20:23:32
【问题描述】:
为了确保我没有搞砸术语,这里是代码示例。我正在使用jQuery Nivoslider,并且我希望能够在我在列表框中更改它们时更改使用的效果。我可以在 div 中显示效果应该是什么,但实际效果并未应用于滑块。
我期待这样的东西:jQuery("#slider").effect = values;但这似乎不起作用。
下面是部分代码:
// Listbox
<select id="slider-effect" name="effect[]" size="10" multiple="multiple" style="height:100px;">
<option value="sliceDownRight">Slice Down to Right</option>
<option value="sliceDownLeft">Slice Down to Left</option>
<option value="boxRain">Rain Boxes</option>
<option value="boxRainReverse">Reverse Box Rain</option>
</select>
// Javascript that setups NivoSlider (actual div is missing, just an example)
// shortend options for the example
jQuery(window).load(function() {
jQuery('#slider').nivoSlider({"effect":"boxRandom"});});
// Javascript that should change the option effect
// this shows me the effect I set (not included in the code here)
jQuery('#slider-effect').change(function() {
var values = jQuery("#slider-effect").val();
jQuery('#slider-message').html('<p>Effect set to:' + values + '</p>');
jQuery("#slider")["effect"] = values;
});
});
【问题讨论】:
-
我同意 :( 终于找到了接受率是什么以及如何处理它。所以接受了我收到的好答案。无论如何感谢您让我知道,希望有人仍然会回答我的问题!
标签: jquery nivo-slider