0

jquery bgswitcher を使用して背景スライダーを作成しようとしています。私のコード

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">

</script>
<script src="js/jquery.bgswitcher.js"></script>

<script>
    $(".wrapper").bgswitcher({
        images: ["img/1.jpg", "img/2.png", "img/3.jpg", "img/4.png"],
        effect: "fade",
        interval: 5000,
        loop: false,
        shuffle: false,
        duration: 5000,
        easing: "swing"
    });
</script>

このコードの何が問題なのかわかりませんが、背景のスライダーが機能しません! 何か案が?

4

1 に答える 1

1

document.ready... で bgswitcher を初期化します。

<script>
$(document).ready(function(){

$(".wrapper").bgswitcher({
images: ["img/1.jpg", "img/2.png", "img/3.jpg", "img/4.png"], 
effect: "fade", 
interval: 5000, 
loop: false, 
shuffle: false, 
duration: 5000, 
easing: "swing"
});

});
</script>
于 2013-08-30T05:22:02.367 に答える