Jump to content
Nordidi13

Slider continue vers l'infini 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 d'avance pour votre aide.

Edited by Nordidi13 (see edit history)

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More