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 : 151
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