2013-08-30 5 views
0

Essayer de créer un curseur d'arrière-plan à l'aide de jquery bgswitcher. Mon codeimpossible de faire fonctionner 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> 

Je ne sais pas quel est le problème avec ce code, mais le curseur d'arrière-plan ne fonctionne pas! Une idée?

+0

essayer 'boucle: false' 'à boucle: true' –

Répondre

1

Initialisez le bgswitcher dans document.ready ...

<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> 
+1

oppssss! C'était si facile !!! Merci Amit Horakeri !! – user2142185

Questions connexes