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 :

Insertion de 2 slideshow dans une même page


Sujet :

JavaScript

  1. #1
    Membre à l'essai
    Homme Profil pro
    Rédacteur technique
    Inscrit en
    Novembre 2015
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Rédacteur technique

    Informations forums :
    Inscription : Novembre 2015
    Messages : 15
    Points : 13
    Points
    13
    Par défaut Insertion de 2 slideshow dans une même page
    Bonjour à toutes et tous,
    J'ai créé un slideshow pour afficher un déroulant de plusieurs bibliographies avec des liens, le tout dans une même page.

    Depuis 24 h et autant de cchets d'aspirine, je bute sur un problème. Malgré la mise en place de "class", l'action sur les flèches de déroulement des pages n'agit pas sur les bonnes pages;

    En image ça donne ça :

    Nom : Capture.JPG
Affichages : 126
Taille : 112,5 Ko

    Et le code (sans les images, le décalage est normal):

    Code html : 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
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    .mySlides1 {display: none}
    img {vertical-align: middle;}
     
    /* Slideshow container */
    .slideshow-container1
    {
      max-width: 400px;
      position: relative;
      margin-left: 7%;
      border:0;
    }
     
    /* les deux boutons */
    .prev1, .next1
    {
      cursor: pointer;
      position: absolute;
      top: 50%;
      width: auto;
      padding: 10px;
      margin-top: 55px;
      margin-left: -20px;
      margin-right: -20px;
      color: #B8860B;
      font-weight: bold;
      font-size: 19px;
      text-decoration : none;
      transition: 0.6s ease;
      border-radius: 0 10px 10px 0;
    }
     
    /* décalage du bouton de droite */
    .next1
    {
      right:-479px;
      border-radius: 10px 0 0 10px;
    }
     
    /* On hover, add a black background color with a little bit see-through */
    .prev1:hover, .next1:hover
    {
      background-color: #D3D3D3;/*fond fleche*/
      text-decoration : none;
    }
     
    /* Nombre (1/3 etc) */
    .numbertext
    {
      color: #B8860B;/*numero de page*/
      font-size: 15px;
      font-weight: bold;
      margin-top: -10px;
      position: absolute;
    }
     
    /* Fading animation */
    .fade
    {
      -webkit-animation-name: fade;
      -webkit-animation-duration: 1s;
      animation-name: fade;
      animation-duration: 1s;
    }
     
    @-webkit-keyframes fade
    {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    @keyframes fade
    {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    </style>
    <div class="slideshow-container1">
     
    <center><table border="1" cellpadding="20px"><tr><td>
     
    <div class="mySlides1">
    <div class="numbertext">1 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
      </tr></table>
    </div>
     
    <div class="mySlides1">
    <div class="numbertext">2 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
      </tr></table>
    </div>
     
    <div class="mySlides1">
    <div class="numbertext">3 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
      </tr></table>
    </div>
     
    <div class="mySlides1">
    <div class="numbertext">4 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
      </tr></table>
    </div>
     
    <div class="mySlides1">
    <div class="numbertext">5 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div>
    <a class="prev1" onclick="plusSlides(-1)"></a>
    <a class="next1" onclick="plusSlides(+1)"></a>
    </div>
    </td></tr></table></center></div>
     
    <script>
    var slideIndex = 1;
    showSlides(slideIndex);
     
    function plusSlides(n) 
    {
      showSlides(slideIndex += n);
    }
     
    function currentSlide(n) 
    {
      showSlides(slideIndex = n);
    }
     
    function showSlides(n) 
    {
      var i;
      var slides = document.getElementsByClassName("mySlides1");
      var dots = document.getElementsByClassName("dot");
      if (n > slides.length) {slideIndex = 1}    
      if (n < 1) {slideIndex = slides.length}
      for (i = 0; i < slides.length; i++) 
    {
          slides[i].style.display = "none";  
      }
      for (i = 0; i < dots.length; i++) {
          dots[i].className = dots[i].className.replace(" active", "");
      }
      slides[slideIndex-1].style.display = "block";  
      dots[slideIndex-1].className += "active";
    }
    </script>
     
    </html> 
     
    ICI COMMENCE LA DEUXIÈME TABLE
     
    <html>
     
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
     
    .mySlides2 {display: none}
    img {vertical-align: middle;}
     
    /* Slideshow container */
    .slideshow-container2
    {
      max-width: 400px;
      position: relative;
      margin-left: 7%;
      border:0;
    }
     
    /* les deux boutons */
    .prev2, .next2
    {
      cursor: pointer;
      position: absolute;
      top: 50%;
      width: auto;
      padding: 10px;
      margin-top: 55px;
      margin-left: -20px;
      margin-right: -20px;
      color: #B8860B;
      font-weight: bold;
      font-size: 19px;
      text-decoration : none;
      transition: 0.6s ease;
      border-radius: 0 10px 10px 0;
    }
     
    /* décalage du bouton de droite */
    .next2
    {
      right:-479px;
      border-radius: 10px 0 0 10px;
    }
     
    /* On hover, add a black background color with a little bit see-through */
    .prev2:hover, .next2:hover 
    {
      background-color: #D3D3D3;/*fond fleche*/
      text-decoration : none;
    }
     
    /* Nombre (1/3 etc) */
    .numbertext
    {
      color: #B8860B;/*couleur numero de page*/
      font-size: 15px;
      font-weight: bold;
      margin-top: -10px;
      position: absolute;
    }
     
    /* Fading animation */
    .fade
    {
      -webkit-animation-name: fade;
      -webkit-animation-duration: 1s;
      animation-name: fade;
      animation-duration: 1s;
    }
     
    @-webkit-keyframes fade
    {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    @keyframes fade
    {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    </style>
     
    <div class="slideshow-container2">
     
    <center><table border="1" cellpadding="20px"><tr><td>
     
    <div class="mySlides2">
    <div class="numbertext">1 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
      </tr></table>
    </div>
     
    <div class="mySlides2">
    <div class="numbertext">2 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
      </tr></table>
    </div>
     
    <div class="mySlides2">
    <div class="numbertext">3 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
      </tr></table>
    </div>
     
    <div class="mySlides2">
    <div class="numbertext">4 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
      </tr></table>
    </div>
     
    <div class="mySlides2">
    <div class="numbertext">5 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
      </tr></table>
    </div>
    <div>
    <a class="prev2" onclick="plusSlides(-1)"></a>
    <a class="next2" onclick="plusSlides(+1)"></a>
    </div>
    </td></tr></table></center></div>
     
    <script>
    var slideIndex = 1;
    showSlides(slideIndex);
     
    function plusSlides(n) 
    {
      showSlides(slideIndex += n);
    }
     
    function currentSlide(n) 
    {
      showSlides(slideIndex = n);
    }
     
    function showSlides(n) 
    {
      var i;
      var slides = document.getElementsByClassName("mySlides2");
      var dots = document.getElementsByClassName("dot");
      if (n > slides.length) {slideIndex = 1}    
      if (n < 1) {slideIndex = slides.length}
      for (i = 0; i < slides.length; i++) {
          slides[i].style.display = "none";  
      }
      for (i = 0; i < dots.length; i++) {
          dots[i].className = dots[i].className.replace(" active", "");
      }
      slides[slideIndex-1].style.display = "block";  
      dots[slideIndex-1].className += "active";
    }
    </script>
     
    </html>

    Merci d'avance pour votre aide, je l'espère...
    Patpierre

  2. #2
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    16 959
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 16 959
    Points : 44 116
    Points
    44 116
    Par défaut
    Bonjour,
    attention tout ton code est dupliqué, le HTML comme le JavaScript, et cela ne pourra donc pas marcher.

    Lorsque l'on déclare plusieurs fois une fonction, même nom, la dernière vue/lue écrase les précédentes
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    function action( param){
      alert("Bonjour de la fonction action.");
    }
    function action(){
      alert("Je t'ai écrasé !");
    }
    action(); // affichera Je t'ai écrasé !
    il te faut donc commencer par mettre de l'ordre

  3. #3
    Membre à l'essai
    Homme Profil pro
    Rédacteur technique
    Inscrit en
    Novembre 2015
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Rédacteur technique

    Informations forums :
    Inscription : Novembre 2015
    Messages : 15
    Points : 13
    Points
    13
    Par défaut
    Bon 1er mai et bonheur à tous et toutes...

    Merci pour cette remarque, bien comprise (ou presque)
    peux-tu me dire si ce que je cherche à faire est possible ou non et si oui ce que je dois changer dans mon code...

    Patpierre

  4. #4
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par NoSmoking Voir le message
    il te faut donc commencer par mettre de l'ordre

  5. #5
    Membre à l'essai
    Homme Profil pro
    Rédacteur technique
    Inscrit en
    Novembre 2015
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Rédacteur technique

    Informations forums :
    Inscription : Novembre 2015
    Messages : 15
    Points : 13
    Points
    13
    Par défaut
    Est-ce une manière de me dire que je mourrais idiot ?... Et qu'à la place, la réponse s'appelle « jamais » on te répondra ?...

  6. #6
    Invité
    Invité(e)
    Par défaut
    1- Non.
    Ca veut dire qu'il faut que TU CORRIGES D'ABORD ton code, pour avoir une structure HTML valide.
    NoSmoking t'a dit quoi faire.

    2- le 2ème point qu'il soulève est que tes fonctions sont toutes EN DOUBLE, avec les mêmes noms de fonction.
    Ca ne peut pas fonctionner ainsi.

    ex. :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    function showSlides(n) 
    {
      var i;
      var slides = document.getElementsByClassName("mySlides1");
    ...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    function showSlides(n) 
    {
      var i;
      var slides = document.getElementsByClassName("mySlides2");
    ...
    Pour pouvoir distinguer à quel slider ça correspond, il faudrait mettre "mySlides1" ou "mySlides1" en paramètre de fonction.

    On aurait alors (UNE SEULE FOIS) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    function showSlides(n, sliderClass) 
    {
      var i;
      var slides = document.getElementsByClassName(sliderClass);
    ...
    Ce n'est qu'un exemple de modification de ton code.


    3- Sinon, il existe des scripts/plugins de sliders "tout-faits".

    Dernière modification par Invité ; 01/05/2018 à 14h22.

  7. #7
    Modérateur
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 077
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 077
    Points : 17 165
    Points
    17 165
    Par défaut
    Salut

    Le code HTML proposé à l'ouverture de ta discussion est plein d'erreurs, avant d'approfondir/rechercher le problème qui te préoccupe, il te faut nettoyer celui-ci.

    Exemples:
    tu as une balise <head> ouvrant mais pas le </head> fermant .....
    tu as un groupe de balises <html> ... <html> et encore un autre <html> ... <html> (ligne 197) .....
    tu as 2 class slideshow-container, un slideshow-container1 et slideshow-container2, un seul suffirait puisque il ont les mêmes paramètres .....
    ......

    C'est cela qui t'ai demandé de nettoyer avant que d'essayer de répondre à ta question.

    Edit: un peu en retard, mais bon .......
    Soyez sympa, pensez -y
    Balises[CODE]...[/CODE]
    Balises[CODE=NomDuLangage]...[/CODE] quand vous mettez du code d'un autre langage que celui du forum ou vous postez.
    Balises[C]...[/C] code intégré dans une phrase.
    Balises[C=NomDuLangage]...[/C] code intégré dans une phrase quand vous mettez du code d'un autre langage que celui du forum ou vous postez.
    Le bouton en fin de discussion, quand vous avez obtenu l'aide attendue.
    ......... et pourquoi pas, pour remercier, un pour celui/ceux qui vous ont dépannés.
    👉 → → Ma page perso sur DVP ← ← 👈

  8. #8
    Membre à l'essai
    Homme Profil pro
    Rédacteur technique
    Inscrit en
    Novembre 2015
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Rédacteur technique

    Informations forums :
    Inscription : Novembre 2015
    Messages : 15
    Points : 13
    Points
    13
    Par défaut
    Merci pour votre intérêt,
    Désolé de vous déranger encore un jour de fête du travail... Mais je ne m'en sors pas...

    J'ai modifié les codes en essayant de suivre les différentes indications, mais ça sort caca :
    Code html : 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
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    .mySlides1 {display: none}
    img {vertical-align: middle;}
     
    /* Slideshow container */
    .slideshow-container
    {
      max-width: 400px;
      position: relative;
      margin-left: 7%;
      border:0;
    }
     
    /* les deux boutons */
    .prev, .next
    {
      cursor: pointer;
      position: absolute;
      top: 50%;
      width: auto;
      padding: 10px;
      margin-top: 55px;
      margin-left: -20px;
      margin-right: -20px;
      color: #B8860B;
      font-weight: bold;
      font-size: 19px;
      text-decoration : none;
      transition: 0.6s ease;
      border-radius: 0 10px 10px 0;
    }
     
    /* décalage du bouton de droite */
    .next
    {
      right:-479px;
      border-radius: 10px 0 0 10px;
    }
     
    /* On hover, add a black background color with a little bit see-through */
    .prev:hover, .next:hover
    {
      background-color: #D3D3D3;/*fond fleche*/
      text-decoration : none;
    }
     
    /* Nombre (1/3 etc) */
    .numbertext
    {
      color: #B8860B;/*numero de page*/
      font-size: 15px;
      font-weight: bold;
      margin-top: -10px;
      position: absolute;
    }
     
    /* Fading animation */
    .fade
    {
      -webkit-animation-name: fade;
      -webkit-animation-duration: 1s;
      animation-name: fade;
      animation-duration: 1s;
    }
     
    @-webkit-keyframes fade
    {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    @keyframes fade
    {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    </style>
    <div class="slideshow-container">
     
    <center><table border="1" cellpadding="20px"><tr><td>
     
    <div class="mySlides1 fade">
    <div class="numbertext">1 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div class="mySlides1 fade">
    <div class="numbertext">2 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div class="mySlides1 fade">
    <div class="numbertext">3 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div class="mySlides1 fade">
    <div class="numbertext">4 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div class="mySlides1 fade">
    <div class="numbertext">5 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div>
    <a class="prev" onclick="plusSlides(-1)"></a>
    <a class="next" onclick="plusSlides(+1)"></a>
    </div>
    </td></tr></table></center></div>
     
    <script>
     
    function showSlides(n, sliderClass) 
    {
      var i;
      var slides = document.getElementsByClassName(sliderClass);
     
    function showSlides(n) 
    {
      var i;
      var slides = document.getElementsByClassName("mySlides");
     
    function showSlides(n, sliderClass) 
    {
      var i;
      var slides = document.getElementsByClassName(sliderClass);
     
    function showSlides(n, sliderClass) 
    {
      var i;
      var slides = document.getElementsByClassName(sliderClass);
     
    var slideIndex = 1;
    showSlides(slideIndex);
     
    function plusSlides(n) 
    {
      showSlides(slideIndex += n);
    }
     
    function currentSlide(n) 
    {
      showSlides(slideIndex = n);
    }
     
    function showSlides(n) 
    {
      var i;
      var slides = document.getElementsByClassName("mySlides1");
      var dots = document.getElementsByClassName("dot");
      if (n > slides.length) {slideIndex = 1}    
      if (n < 1) {slideIndex = slides.length}
      for (i = 0; i < slides.length; i++) 
    {
          slides[i].style.display = "none";  
      }
      for (i = 0; i < dots.length; i++) {
          dots[i].className = dots[i].className.replace(" active", "");
      }
      slides[slideIndex-1].style.display = "block";  
      dots[slideIndex-1].className += "active";
    }
    </script>
    </body>
     
    ET DANS LE DEUXIÈME PARAGRAPHE (sur la même page)
     
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
    .mySlides2 {display: none}
    img {vertical-align: middle;}
     
    /* Slideshow container */
    .slideshow-container
    {
      max-width: 400px;
      position: relative;
      margin-left: 7%;
      border:0;
    }
     
    /* les deux boutons */
    .prev, .next
    {
      cursor: pointer;
      position: absolute;
      top: 50%;
      width: auto;
      padding: 10px;
      margin-top: 55px;
      margin-left: -20px;
      margin-right: -20px;
      color: #B8860B;
      font-weight: bold;
      font-size: 19px;
      text-decoration : none;
      transition: 0.6s ease;
      border-radius: 0 10px 10px 0;
    }
     
    /* décalage du bouton de droite */
    .next
    {
      right:-479px;
      border-radius: 10px 0 0 10px;
    }
     
    /* On hover, add a black background color with a little bit see-through */
    .prev:hover, .next:hover
    {
      background-color: #D3D3D3;/*fond fleche*/
      text-decoration : none;
    }
     
    /* Nombre (1/3 etc) */
    .numbertext
    {
      color: #B8860B;/*numero de page*/
      font-size: 15px;
      font-weight: bold;
      margin-top: -10px;
      position: absolute;
    }
     
    /* Fading animation */
    .fade
    {
      -webkit-animation-name: fade;
      -webkit-animation-duration: 1s;
      animation-name: fade;
      animation-duration: 1s;
    }
     
    @-webkit-keyframes fade
    {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    @keyframes fade
    {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    </style>
    <body>
    <div class="slideshow-container">
     
    <center><table border="1" cellpadding="20px"><tr><td>
     
    <div class="mySlides2 fade">
    <div class="numbertext">1 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div class="mySlides2 fade">
    <div class="numbertext">2 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div class="mySlides2 fade">
    <div class="numbertext">3 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div class="mySlides2 fade">
    <div class="numbertext">4 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div class="mySlides2 fade">
    <div class="numbertext">5 / 5</div>
    <table cellpadding="10"><tr>
    <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<br><font color="#BC8F8F"><i><center>Granit</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_ASCENSION%<font color="#BC8F8F"><i><br><center>Ascension</center></a></td>
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none">%BI_GRANIT1%<font color="#BC8F8F"><i><br><center>Granit</center></a></td>
     
    </tr></table>
    </div>
     
    <div>
    <a class="prev" onclick="plusSlides(-1)"></a>
    <a class="next" onclick="plusSlides(+1)"></a>
    </div>
    </td></tr></table></center></div>
     
    <script>
     
    function showSlides(n) 
    {
      var i;
      var slides = document.getElementsByClassName("mySlides");
     
    var slideIndex = 1;
    showSlides(slideIndex);
     
    function plusSlides(n) 
    {
      showSlides(slideIndex += n);
    }
     
    function currentSlide(n) 
    {
      showSlides(slideIndex = n);
    }
     
    function showSlides(n) 
    {
      var i;
      var slides = document.getElementsByClassName("mySlides2");
      var dots = document.getElementsByClassName("dot");
      if (n > slides.length) {slideIndex = 1}    
      if (n < 1) {slideIndex = slides.length}
      for (i = 0; i < slides.length; i++) 
    {
          slides[i].style.display = "none";  
      }
      for (i = 0; i < dots.length; i++) {
          dots[i].className = dots[i].className.replace(" active", "");
      }
      slides[slideIndex-1].style.display = "block";  
      dots[slideIndex-1].className += "active";
    }
    </script>
    </body>
    </html>
    Encore merci pour votre aide
    Pat pierre

  9. #9
    Invité
    Invité(e)
    Par défaut


    Va profiter du 1er mai...

  10. #10
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    16 959
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 16 959
    Points : 44 116
    Points
    44 116
    Par défaut
    Il te faut faire le travail méthodiquement, cela n'est dans ce cas pas bien compliqué.
    A partir de cette trame de base
    Code html : 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
    <!DOCTYPE html>
    <html lang="fr">
    <head>
    <meta charset="UTF-8">
    <title>Titre de ta page</title>
    <style>
      /* ICI les données du STYLE  */
    </style>
    </head>
    <body>
      <!-- ICI les données du BODY -->
    <script>
      /* ICI les données de SCRIPT */
    </script>
    </body>
    </html>
    Tu reportes tout ce qui se trouve entre tes balises <style></style>, tu as 2 endroits concernés, entre les balises <style></style> de la trame.
    Tu reportes tout ce qui se trouve entre tes balises <body></body>, tu as 2 endroits concernés, entre les balises <body></body> de la trame, attention à ne pas écraser les balises <script></script>.
    Tu reportes tout ce qui se trouve entre tes balises <script></script>, tu as 2 endroits concernés, entre les balises <script></script> de la trame.

    Ensuite on pourra passer au simplification-explication de tes fonctions, la simplification de ton code CSS sera une autre histoire.

    Au final le code devrait faire une quinzaine de lignes, la solution étant effectivement de passer en paramètre le slide concerné.

  11. #11
    Membre à l'essai
    Homme Profil pro
    Rédacteur technique
    Inscrit en
    Novembre 2015
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Rédacteur technique

    Informations forums :
    Inscription : Novembre 2015
    Messages : 15
    Points : 13
    Points
    13
    Par défaut
    Merci pour cette réponse, j'ai cru que vous m'abandonniez et je m'étais remis à la broderie (où j'excelle...)

    J'ai donc remis mon code en ordre selon ces dernières indications (dont je vous remercie) :

    Code html : 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
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    <!DOCTYPE html>
    <html lang="fr">
    <head>
    <meta charset="UTF-8">
    <title>Bibliographies</title>
     
    <style>
    * {box-sizing: border-box}
    body {font-family: Verdana, sans-serif; margin:0}
    .mySlides {display: none}
    img {vertical-align: middle;}
     
    /* Slideshow container */
    .slideshow-container {
      max-width: 400px;
      position: relative;
      margin-left: 7%;
      border:0;
    }
     
    /* les deux boutons */
    .prev, .next {
      cursor: pointer;
      position: absolute;
      top: 50%;
      width: auto;
      padding: 10px;
      margin-top: 55px;
      margin-left: -20px;
      margin-right: -20px;
      color: #B8860B;
      font-weight: bold;
      font-size: 19px;
      text-decoration : none;
      transition: 0.6s ease;
      border-radius: 0 10px 10px 0;
    }
     
    /* décalage du bouton de droite */
    .next {
      right:-479px;
      border-radius: 10px 0 0 10px;
    }
     
    /* On hover, add a black background color with a little bit see-through */
    .prev:hover, .next:hover {
      background-color: #D3D3D3;/*fond fleche*/
      text-decoration : none;
    }
     
    /* Nombre (1/3 etc) */
    .numbertext {
      color: #B8860B;/*numero de page*/
      font-size: 15px;
      font-weight: bold;
      margin-top: -10px;
      position: absolute;
    }
     
    /* Fading animation */
    .fade {
      -webkit-animation-name: fade;
      -webkit-animation-duration: 1s;
      animation-name: fade;
      animation-duration: 1s;
    }
     
    @-webkit-keyframes fade {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    @keyframes fade {
      from {opacity: .4} 
      to {opacity: 1}
    }
     
    </style>
     
    </head>
     
    <body>
     
    <div class="slideshow-container">
     
    <center><table border="1" cellpadding="20px"><tr><td>
     
    <div class="mySlides fade">
      <div class="numbertext">1 / 6</div>
      <table cellpadding="10"><tr>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
      onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;">
      <br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg"  title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      </tr></table>
     
    </div>
     
    <div class="mySlides fade">
      <div class="numbertext">2 / 6</div>
      <table cellpadding="10"><tr>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
      onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;">
      <br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg"  title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      </tr></table>
     
    </div>
     
    <div class="mySlides fade">
      <div class="numbertext">3 / 6</div>
      <table cellpadding="10"><tr>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
      onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;">
      <br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg"  title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      </tr></table>
     
    </div>
     
    <div class="mySlides fade">
      <div class="numbertext">4 / 6</div>
      <table cellpadding="10"><tr>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
      onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;">
      <br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg"  title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      </tr></table>
     
    </div>
     
    <div class="mySlides fade">
      <div class="numbertext">5 / 6</div>
      <table cellpadding="10"><tr>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
      onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;">
      <br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg"  title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      </tr></table>
     
    </div>
     
    <div class="mySlides fade">
      <div class="numbertext">6 / 6</div>
      <table cellpadding="10"><tr>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
      onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;">
      <br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg"  title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      <td><a href="http://www.pierres-info.fr/accueil/index.html" style="text-decoration : none"><img src="ascension.jpg" title="Voir"
    onmouseover="this.style.opacity=0.5;this.filters.alpha.opacity=50;" 
    onmouseout="this.style.opacity=1;this.filters.alpha.opacity=1;"/><br><font color="#BC8F8F"><i><center>Ascension</center></a></td>
     
      </tr></table>
     
    </div>
     
     
     
    <a class="prev" onclick="plusSlides(-1)"></a>
    <a class="next" onclick="plusSlides(1)"></a>
     
    </div></td></tr></table></center>
     
    <script>
      /* ICI les données de SCRIPT */
    var slideIndex = 1;
    showSlides(slideIndex);
     
    function plusSlides(n) {
      showSlides(slideIndex += n);
    }
     
    function currentSlide(n) {
      showSlides(slideIndex = n);
    }
     
    function showSlides(n) {
      var i;
      var slides = document.getElementsByClassName("mySlides");
      var dots = document.getElementsByClassName("dot");
      if (n > slides.length) {slideIndex = 1}    
      if (n < 1) {slideIndex = slides.length}
      for (i = 0; i < slides.length; i++) {
          slides[i].style.display = "none";  
      }
      for (i = 0; i < dots.length; i++) {
          dots[i].className = dots[i].className.replace(" active", "");
      }
      slides[slideIndex-1].style.display = "block";  
      dots[slideIndex-1].className += " active";
    }
     
    </script>
    </body>
    </html>

    Voilà ce que ça donne en 1 exemplaire de slideshow. Maintenant, pour le doubler, et pour ne pas faire n'importe quoi, merci de me confirmer où je dois agir...
    Si j'ai bien compris précédemment il faut renommer "mySlides"
    - Dans chaque SCRIPT, comme ça > .mySlides1 {display: none} .mySlides2 {display: none} etc...
    - Dans le body, comme ça > <div class="mySlides1 fade"> <div class="mySlides2 fade"> etc...
    - Dans le deuxième script, comme ça >
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     function showSlides(n) {
      var i;
      var slides = document.getElementsByClassName("mySlides1");---("mySlides2");
    Enfin, ajouter dans le premier script :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    function showSlides(n, sliderClass) 
    {
      var i;
      var slides = document.getElementsByClassName(sliderClass);
    Ai-je bon ?...
    Merci
    Patpierre

  12. #12
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    Je t'ai fait un script * qui fonctionne : https://codepen.io/jreaux62/pen/qYmvWY
    (* adapté du tien)

    Code css : 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
    * {margin:0; padding:0; box-sizing: border-box; }
    body {font-family: Verdana, sans-serif; }
     
    /* Slideshow container */
    .slideshow-container {
      position: relative;
      margin:20px auto;
    }
     
    .slideshow .item { display:none; }
    .slideshow .item table { width:100%; border-collapse:collapse; }
     
    .slideshow .item td { padding:10px; text-align:center; vertical-align:bottom; }
    .slideshow .item td a { color:#666; text-decoration:none; }
    .slideshow .item td i { color:#666; }
     
    .slideshow .item img { opacity:0.5; max-width:100px; max-height:100px; }
    .slideshow .item img:hover { opacity:1.0; }
     
    /* Nombre (1/3 etc) */
    .numbertext {
      color: #B8860B;/*numero de page*/
      font-size: 15px;
      font-weight: bold;
      top:-10px;
      left:10px;
      position: absolute;
    }
     
    /* les deux boutons */
    .slideshow-container .prev, 
    .slideshow-container .next {
      cursor: pointer;
      position: absolute;
      left:0;
      top: 15px;
      width: auto;
      padding: 10px;
      color: #B8860B;
      font-weight: bold;
      font-size: 19px;
      text-decoration : none;
      transition: 0.6s ease;
      border-radius: 0 10px 10px 0;
      z-index:11;
    }
     
    /* décalage du bouton de droite */
    .slideshow-container .next {
      right:0; left:auto;
      border-radius: 10px 0 0 10px;
    }
     
    /* On hover, add a black background color with a little bit see-through */
    .slideshow-container .prev:hover, .slideshow-container .next:hover {
      background-color: #D3D3D3;/*fond fleche*/
      text-decoration : none;
    }

    Code JavaScript : 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
    /* Initialisation */
    var slideIndex = 1;
    showSlidesInit('slideshow_1');
    showSlidesInit('slideshow_2');
     
    function showSlidesInit(SliderId) {
      showSlides(slideIndex = 1, SliderId);
    }
    function showSlides(n, SliderId) {
      var i;
      var slides = document.querySelectorAll('#' + SliderId + ' div.item');
      if (n > slides.length) {slideIndex = 1}    
      if (n < 1) {slideIndex = slides.length}
      for (i = 0; i < slides.length; i++) {
          slides[i].style.display = "none";  
      }
      slides[slideIndex-1].style.display = "block";  
     
      document.querySelector('#' + SliderId + ' > div.numbertext > .SlideNumber').innerHTML = slideIndex;
      document.querySelector('#' + SliderId + ' > div.numbertext > .SlideTotal').innerHTML = slides.length;
    }
    function plusSlides(n, SliderId) {
      showSlides(slideIndex += n, SliderId);
    }

    Code html : 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
    <div class="slideshow-container" id="slideshow_1">
     
    	<div class="numbertext"><span class="SlideNumber"></span> / <span class="SlideTotal"></span></div>
    	<a class="prev" onclick="plusSlides(-1, 'slideshow_1')"></a>
    	<a class="next" onclick="plusSlides(1, 'slideshow_1')"></a>
     
      <div class="slideshow">
     
    	<div class="item">
    		<table>
    			<tr>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir" /><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213" title="Voir"/><br><i>Ascension</i></a></td>
    			</tr>
    		</table>
    	</div>
     
    	<div class="item">
    		<table>
    			<tr>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    			</tr>
    		</table>
    	</div>
     
    	<div class="item">
    		<table>
    			<tr>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    			</tr>
    		</table>
    	</div>
     
      </div>
     
    </div>
     
    <div class="slideshow-container" id="slideshow_2">
     
    	<div class="numbertext"><span class="SlideNumber"></span> / <span class="SlideTotal"></span></div>
    	<a class="prev" onclick="plusSlides(-1, 'slideshow_2')"></a>
    	<a class="next" onclick="plusSlides(1, 'slideshow_2')"></a>
     
      <div class="slideshow">
     
    	<div class="item">
    		<table>
    			<tr>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir" /><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir" /><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir" /><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir" /><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir" /><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir" /><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir" /><br><i>Ascension</i></a></td>
    			</tr>
    		</table>
    	</div>
     
    	<div class="item">
    		<table>
    			<tr>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir" /><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/256045-jreaux62.gif?dateline=1487190201" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213" title="Voir"/><br><i>Ascension</i></a></td>
    			</tr>
    		</table>
    	</div>
     
    	<div class="item">
    		<table>
    			<tr>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/405341-nosmoking.gif?dateline=1420739142" title="Voir"/><br><i>Ascension</i></a></td>
    			</tr>
    		</table>
    	</div>
     
    	<div class="item">
    		<table>
    			<tr>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    				<td><a href="#"><img src="https://www.developpez.net/forums/avatars/51625-progelect.gif?dateline=1159631213"  title="Voir"/><br><i>Ascension</i></a></td>
    			</tr>
    		</table>
    	</div>
     
      </div>
     
    </div>
    Si tu respectes la structure HTML que j'ai mise, tu peux ajouter autant de sliders que tu veux.

    Pour un 3ème slider "slideshow_3", AJOUTER :
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    <div class="slideshow-container" id="slideshow_3">
     
    	<div class="numbertext"><span class="SlideNumber"></span> / <span class="SlideTotal"></span></div>
    	<a class="prev" onclick="plusSlides(-1, 'slideshow_3')"></a>
    	<a class="next" onclick="plusSlides(1, 'slideshow_3')"></a>
    ......
    En JavaScript il faut juste RAJOUTER UNE ligne :
    Code JavaScript : Sélectionner tout - Visualiser dans une fenêtre à part
    showSlidesInit('slideshow_3');

    Cadeau Bonux :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    	<div class="numbertext"><span class="SlideNumber"></span> / <span class="SlideTotal"></span></div>
    Les numéro de slide et leur nombre s'affichent AUTOMATIQUEMENT.

  13. #13
    Membre à l'essai
    Homme Profil pro
    Rédacteur technique
    Inscrit en
    Novembre 2015
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Rédacteur technique

    Informations forums :
    Inscription : Novembre 2015
    Messages : 15
    Points : 13
    Points
    13
    Par défaut
    Un grand merci pour ton aide, ta patience, et surtout pour le cadeau Bonux...
    ça fonctionne du tonnerre !...

    Patpierre

  14. #14
    Modérateur
    Avatar de ProgElecT
    Homme Profil pro
    Retraité
    Inscrit en
    Décembre 2004
    Messages
    6 077
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 68
    Localisation : France, Haute Savoie (Rhône Alpes)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Décembre 2004
    Messages : 6 077
    Points : 17 165
    Points
    17 165
    Par défaut
    Salut
    Citation Envoyé par patpierre Voir le message
    Est-ce une manière de me dire que je mourrais idiot ?... Et qu'à la place, la réponse s'appelle « jamais » on te répondra ?...
    DVP est un site particulier, tu en as la preuve, des fois on se fait remonter les bretelles, mais quasi toujours tu as une réponse à ta problématique.
    Maintenant il te reste à étudier/comprendre pour que tu deviennes autonome, ou au moins pouvoir revenir pour poser une code qui ne fera cette fois ci râler la communauté .
    Soyez sympa, pensez -y
    Balises[CODE]...[/CODE]
    Balises[CODE=NomDuLangage]...[/CODE] quand vous mettez du code d'un autre langage que celui du forum ou vous postez.
    Balises[C]...[/C] code intégré dans une phrase.
    Balises[C=NomDuLangage]...[/C] code intégré dans une phrase quand vous mettez du code d'un autre langage que celui du forum ou vous postez.
    Le bouton en fin de discussion, quand vous avez obtenu l'aide attendue.
    ......... et pourquoi pas, pour remercier, un pour celui/ceux qui vous ont dépannés.
    👉 → → Ma page perso sur DVP ← ← 👈

  15. #15
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    16 959
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 16 959
    Points : 44 116
    Points
    44 116
    Par défaut
    Jérôme ton code présente une faille en ce qui concerne l'utilisation d'un seul slideIndex pour les différents « slides » possibles, il y a collision.

    Il te faut gérer un tableau d'index, un par « slide ».

    Pour aller plus loin, mais à peine, il y a moyen de n'utiliser qu'un seule et même fonction pour tout faire.

    En partant du code fourni j'en arriverai à cela
    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
    // pour gestion de la position
    // l'index des array commence à 0
    // ici on ne va pas utiliser l'index 0 du tableau
    var slideIndex = [0, 0, 0];
    // fonction unique d'affichage
    function showSlides(inc, numSlide) {
      var i;
      var sId = "#slideshow_" + numSlide;
      // récupération des slides
      var slides = document.querySelectorAll(sId + " div.item");
      // gestion aux bornes
      var posMaxi = slides.length - 1;
      // récup. numéro à afficher
      var pos = slideIndex[numSlide] + inc;
      if (pos > posMaxi) {
        pos = 0;
      }
      if (pos < 0) {
        pos = posMaxi;
      }
      // mise à jour index
      slideIndex[numSlide] = pos;
      // masquage de tous les éléments
      for (i = 0; i < slides.length; i++) {
        slides[i].style.display = "none";
      }
      // affichage du concerné
      slides[pos].style.display = "block";
      // affichage position
      document.querySelector(sId + " .SlideNumber").innerHTML = pos + 1;
      document.querySelector(sId + " .SlideTotal").innerHTML = slides.length;
    }
    // montre les slides
    showSlides(0, 1);
    showSlides(0, 2);
    l'appel sur les boutons devenant
    Code html : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    <a class="prev" onclick="showSlides(-1, 1)"></a>
    <a class="next" onclick="showSlides(1, 1)"></a>
    <!-- et plus loin -->
    <a class="prev" onclick="showSlides(-1, 2)"></a>
    <a class="next" onclick="showSlides(1, 2)"></a>
    <!-- etc -->
    on pourrait même aller encore plus loin, mais à peine, en mettant une boucle d'initialisation pour l'affectation des événements aux boutons et l'initialisation du tableau d'index.

    ! Le principal étant que l'on voit bien ici qu'il ne sert à rien de dupliquer les fonctions pour arriver à ses fins mais que la factorisation permet de rendre le code plus lisible et compact.

  16. #16
    Invité
    Invité(e)
    Par défaut
    @NoSmoking
    Oui, je suis d'accord avec toi.

    Cela dit :
    1. J'ai adapté "à la louche" le script initial
    2. Mon niveau de JavaScript n'est pas suffisant pour en faire plus.

    Je sais que d'autres sont bien plus aptes à optimiser le codes.

  17. #17
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    16 959
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 16 959
    Points : 44 116
    Points
    44 116
    Par défaut
    1. J'ai adapté "à la louche" le script initial
    pas de soucis tant que tu fais ça à la louche et pas à l’écumoire

    L'essentiel est que tu as donné le principe.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. insertion de plusieurs modules dans une même page
    Par arkarros dans le forum jQuery
    Réponses: 1
    Dernier message: 26/04/2012, 16h02
  2. Insert Into dans une même page que la création de la table
    Par keke21410 dans le forum Langage SQL
    Réponses: 1
    Dernier message: 19/07/2010, 09h56
  3. Réponses: 7
    Dernier message: 13/10/2006, 00h45
  4. Plusieurs style de liens dans une même page
    Par keishah dans le forum Balisage (X)HTML et validation W3C
    Réponses: 5
    Dernier message: 23/08/2006, 14h22

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