IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

HomeSlider Sous prestashop, Width incorrecte.


Sujet :

JavaScript

  1. #1
    Membre régulier
    Femme Profil pro
    Développeur Web
    Inscrit en
    Mai 2014
    Messages
    107
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 30
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Conseil

    Informations forums :
    Inscription : Mai 2014
    Messages : 107
    Points : 118
    Points
    118
    Par défaut HomeSlider Sous prestashop, Width incorrecte.
    Bonjour,

    J'ai installer un diaporama,

    J'ai voulut changer la taille des images à 730px mais le problème quand le diapo change d'image, on voit l'image précédente car le diaporama a été conçu pour être décalé de 690 px j'imagine..

    Donc au lieu de faire -730px à chaque fois, il fait -690px du coût je me retrouve à la cinquième diapo, avec une demi slide de la précédente et l'autre demi de la suivante.


    J'ai essayer tous. Je n'y arrive pas ...

    Je vous poste un extrait de mon code :

    Code :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    '<div class="' + options.wrapperClass + '" style="width:730px; position:relative;"></div>').wrap('<div class="bx-window" style="position:relative; overflow:hidden; width:730px;"></div>').css({
        width: '999999px',
        position: 'relative',
        left: '-730px'
    });
    $parent.children().css({
        width: '730px',
        'float': 'left',
        listStyle: 'none'
    });
    $outerWrapper = $parent.parent().parent();
    $children.addClass('pager');
    }
    else if (options.mode == 'vertical') {
        $parent.wrap('<div class="' + options.wrapperClass + '" style="width:730px; position:relative;"></div>').wrap('<div class="bx-window" style="width:730px; height:' + wrapperHeight + 'px;
     position:relative;
     overflow:hidden;"></div>').css({
            height: '999999px',
            position: 'relative',
            top: '-' + (origTop) + 'px'
        });
        $parent.children().css({
            listStyle: 'none',
            height: childrenMaxHeight
        });
        $outerWrapper = $parent.parent().parent();
        $children.addClass('pager');
    } else if (options.mode == 'fade') {
        $parent.wrap('<div class="' + options.wrapperClass + '" style="width:730px; position:relative;"></div>').
     
        wrap('<div class="bx-window" style="height:' + childrenMaxHeight + 'px; width:730px; position:relative; overflow:hidden;"></div>');
        $parent.children().css({
            listStyle: 'none',
            position: 'absolute',
            top: 0,
            left: 0,
            zIndex: 98
        });
        $outerWrapper = $parent.parent().parent();
        $children.not(':eq(' + currentSlide + ')').fadeTo(0, 0);
        $children.eq(currentSlide).css('zIndex', 99);
    }
    if (options.captions && options.captionsSelector == null) {
        $outerWrapper.append('<div class="bx-captions"></div>');
    }
    }
     
    function setChildrenLayout() {
        if (options.mode == 'horizontal' || options.mode == 'vertical') {
            var $prependedChildren = getArraySample($children, 0, options.moveSlideQty, 'backward');
            $.each($prependedChildren, function (index) {
                $parent.prepend($(this));
            });
            var totalNumberAfterWindow = ($children.length + options.moveSlideQty) - 1;
            var pagerExcess = $children.length - options.displaySlideQty;
            var numberToAppend = totalNumberAfterWindow - pagerExcess;
            var $appendedChildren = getArraySample($children, 0, numberToAppend, 'forward');
            if (options.infiniteLoop) {
                $.each($appendedChildren, function (index) {
                    $parent.append($(this));
                });
            }
        }
    }
     
    function setControlsVars() {
        if (options.nextImage != '') {
            nextContent = options.nextImage;
            nextType = 'image';
        } else {
            nextContent = options.nextText;
            nextType = 'text';
        }
        if (options.prevImage != '') {
            prevContent = options.prevImage;
            prevType = 'image';
        } else {
            prevContent = options.prevText;
            prevType = 'text';
        }
        showControls(nextType, nextContent, prevType, prevContent);
    }
     
    function setAutoInterval() {
        if (options.auto) {
            if (!options.infiniteLoop) {
                if (options.autoDirection == 'next') {
                    interval = setInterval(function () {
                        currentSlide += options.moveSlideQty;
                        if (currentSlide > lastSlide) {
                            currentSlide = currentSlide % $children.length;
                        }
                        base.goToSlide(currentSlide, false);
                    }, options.pause);
                } else if (options.autoDirection == 'prev') {
                    interval = setInterval(function () {
                        currentSlide -= options.moveSlideQty;
                        if (currentSlide < 0) {
                            negativeOffset = (currentSlide % $children.length);
                            if (negativeOffset == 0) {
                                currentSlide = 0;
                            } else {
                                currentSlide = ($children.length) + negativeOffset;
                            }
                        }
                        base.goToSlide(currentSlide, false);
                    }, options.pause);
                }
            } else {
                if (options.autoDirection == 'next') {
                    interval = setInterval(function () {
                        base.goToNextSlide(false);
                    }, options.pause);
                } else if (options.autoDirection == 'prev') {
                    interval = setInterval(function () {
                        base.goToPreviousSlide(false);
                    }, options.pause);
                }
            }
        } else if (options.ticker) {
            options.tickerSpeed *= 10;
            $('.pager', $outerWrapper).each(function (index) {
                origShowWidth += $(this).width();
                origShowHeight += $(this).height();
            });
            if (options.tickerDirection == 'prev' && options.mode == 'horizontal')
     
     
            {
                $parent.css('left', '-' + (origShowWidth + origLeft) + 'px');
            } else if (options.tickerDirection == 'prev' && options.mode == 'vertical') {
                $parent.css('top', '-' + (origShowHeight + origTop) + 'px');
            }
            if (options.mode == 'horizontal') {
                tickerLeft = parseInt($parent.css('left'));
                moveTheShow(tickerLeft, origShowWidth, options.tickerSpeed);
            } else if (options.mode == 'vertical') {
                tickerTop = parseInt($parent.css('top'));
                moveTheShow(tickerTop, origShowHeight, options.tickerSpeed);
            }
            if (options.tickerHover) {
                setTickerHover();
            }
        }
    }
     
    function moveTheShow(leftCss, distance, speed) {
        if (options.mode == 'horizontal') {
            if (options.tickerDirection == 'next')
     
            {
                $parent.animate({
                    'left': '-=730px'
                }, speed, 'linear', function () {
                    $parent.css('left', leftCss);
                    moveTheShow(leftCss, origShowWidth, options.tickerSpeed);
                });
            } else if (options.tickerDirection == 'prev') {
                $parent.animate(
     
                {
                    'left': '+=730px'
                }, speed, 'linear', function () {
                    $parent.css('left', leftCss);
                    moveTheShow(leftCss, origShowWidth, options.tickerSpeed);
                });
            }
        } else if (options.mode == 'vertical') {
            if (options.tickerDirection == 'next') {
                $parent.animate({
                    'top': '-=730px'
                }, speed, 'linear', function () {
                    $parent.css('top', leftCss);
                    moveTheShow(leftCss, origShowHeight, options.tickerSpeed);
                });
            } else if (options.tickerDirection == 'prev') {
                $parent.animate({
                    'top': '+=730px'
                }, speed, 'linear', function ()
    Nom : Capture.PNG
Affichages : 123
Taille : 22,8 Ko
    Voici la ligne qui ne fonctionne pas dans la classe homeslider, les valeurs sont recalculés à chaque fois qu'on change une diapo SAUF QUE Le left fait -690 à chaque fois AU LIEU de -730px

  2. #2
    Membre confirmé Avatar de 01001111
    Homme Profil pro
    Développeur Web
    Inscrit en
    Janvier 2009
    Messages
    319
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Loire (Auvergne)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Janvier 2009
    Messages : 319
    Points : 509
    Points
    509
    Par défaut
    Bonsoir, comme il ne semble pas y avoir tout le code source de la page, les dépendances css, et le js complet, j'aurai du mal à tester une solution,
    mais pour te mettre sur la piste, le problème semble venir du post traitement de la fonction animate, avec le setting par la fonction css basé sur tickerLeft, lui-même issu d'une lecture css.
    0x4F

Discussions similaires

  1. [PrestaShop] HomeSlider, Width incorrecte.
    Par 01Please dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 0
    Dernier message: 01/07/2015, 14h14
  2. [PrestaShop] Modification gestion des comptes clients
    Par openlife dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 0
    Dernier message: 20/04/2011, 12h52
  3. Utiliser Google Analytics pour un site sous PrestaShop
    Par youza dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 2
    Dernier message: 28/12/2010, 18h21
  4. positionnement css sous prestashop
    Par colorandesign dans le forum Mise en page CSS
    Réponses: 4
    Dernier message: 27/11/2009, 17h07
  5. $(window).width() incorrect
    Par benji07 dans le forum jQuery
    Réponses: 1
    Dernier message: 29/05/2008, 15h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo