このhttp://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider 簡単なスライダー 1.7 を使用して、ウェブサイトでいくつかのスライドショーを実現しています。
スライドショーが 1 つしかない場合は、正常に機能します。しかし、ウェブページの 2 つの異なる場所でスライドショーを行う必要があります。そのため、次/前のボタンを使用すると、両方のスライドが前後に移動します。
2 つの div のボタンに個別の ID を作成しました。また、2 つの div には個別の ID があります。
以下のコードは、スライドを呼び出します。
<script type="text/javascript">
$(document).ready(function(){
$("#slide1").easySlider({
auto: true,
continuous: true
});
$("#slide2").easySlider({
auto: true,
continuous: true
});
});
</script>
私のjavascriptファイルには、次のものがあります。
(関数($) {
$.fn.easySlider = function(options){
// default configuration properties
var defaults = {
prevId: 'prevBtn',
prevText: 'Previous',
nextId: 'nextBtn',
prevId1: 'prevBtn1',
nextId1: 'nextBtn1',
nextText: 'Next',
controlsShow: true,
controlsBefore: '',
controlsAfter: '',
controlsFade: true,
firstId: 'firstBtn',
firstText: 'First',
firstShow: false,
lastId: 'lastBtn',
lastText: 'Last',
lastShow: false,
vertical: false,
speed: 800,
auto: false,
pause: 2000,
continuous: false,
numeric: false,
numericId: 'controls'
};
誰でも助けてもらえますか?