용어를 엉망으로 만들지 않으려면 다음 코드 예제를 참조하십시오. 나는 jQuery Nivoslider을 사용하고 있으며 목록 상자에서 변경했을 때 사용 된 효과를 변경할 수 있기를 원합니다. div에서 효과를 나타내야하지만 실제 효과는 슬라이더에 적용되지 않습니다.동적으로 jQuery 객체 옵션/속성을 설정하십시오.
jQuery ("# slider")와 같은 것을 기대하고있었습니다. 그러나 그것은 작동하지 않는 것 같습니다.
// 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;
});
});
나는 동의한다. (마침내 받아 들일 수있는 속도는 무엇인지, 어떻게 다루는지를 알아 냈다. 내가받은 좋은 대답. 어쨌든 나를 잘 알게 해주셔서 감사 드리며, 누군가 내 질문에 계속 응답 해 주실 것입니다. – JanWillem