Jump to content

Slideshow contrôlable JQUERY


Recommended Posts

Bonjour,

Prestashop version 1.6.1.13

Website : wow-berry.fr

 

suite à la création d'un slider en JQUERY , je rencontre un problèmes:

- le slide vers la droite continu indéfiniment

 

Je vous donne le code :

<script>
$(document).ready(function() {
    slider.init();
});
slider = {
    init: function() {
        slider.elem = $("#shadw");
        slider.nbSlide = slider.elem.find("article").lenght;
        slider.current = 0;
        $("#fleche_droite").click(function() {
            slider.next();
        });
        $("#fleche_gauche").click(function() {
            slider.prev();
        });

    },
    next: function() {
        slider.current++;
        slider.elem.animate({
            marginLeft: -slider.current*340 + "px"
        });
       },
        prev: function() {
        slider.current--;
        
        slider.elem.animate({
            marginLeft: -slider.current*340 + "px"
        });
    }
}
</script>

Merci beaucoup de votre aide !

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...