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 :

ecrire du texte sur les images du diaporama


Sujet :

JavaScript

  1. #1
    Membre du Club
    Inscrit en
    Janvier 2008
    Messages
    97
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 97
    Points : 42
    Points
    42
    Par défaut ecrire du texte sur les images du diaporama
    Bonjour,

    J'utilise un code javascript qui me permet de réaliser un défillement des images, mais je sais pas comment je peux insérer du texte sur les images?
    Avez vous une idée?

    Trés cordialement

  2. #2
    Membre expérimenté Avatar de DoubleU
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    1 106
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2006
    Messages : 1 106
    Points : 1 388
    Points
    1 388
    Par défaut
    Comment tu esperes qu'on puisse t'aider si tu ne nous montre pas à minimum de code...

  3. #3
    Membre du Club
    Inscrit en
    Janvier 2008
    Messages
    97
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 97
    Points : 42
    Points
    42
    Par défaut
    Bonjour,

    je vous envoie le code que j'utilise pour faire l'animation.


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    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
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    <BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0" >
     <!--onLoad="javascript:runscroll()"-->
    <STYLE>
    a:visited {
     font-family: Arial, Helvetica, sans-serif;
     font-size: 11px;
     color: #000000;
     text-decoration: underline; 
    }
    a:link {
     font-family: Arial, Helvetica, sans-serif;
     font-size: 11px;
     color: #000000;
     text-decoration: underline;
     
    }
    a:hover {
     font-family: Arial, Helvetica, sans-serif;
     font-size: 11px;
     color: #F15822;
     text-decoration: none;
    }
     
    a:active {
     font-family: Arial, Helvetica, sans-serif;
     font-size: 11px;
     color: #000000;
     text-decoration: underline;
     
    }
    </STYLE>
    <DIV style="MARGIN-LEFT: 2px; margin-top:2px">
     
    <SCRIPT language=JavaScript >
    /******************************************************************************
    * scroller.js                                                                 *
    *                                                                             *
    * Copyright 1999 by Mike Hall.                                                *
    * Web address: <a href="http://www.brainjar.com" target="_blank">http://www.brainjar.com</a>                                        *
    * Last update: March 21, 2000.                                                *
    *                                                                             *
    * Allows you to create scrolling displays on a page. Multiple scrollers can   *
    * be defined, each with it's own parameters and list of items. Item text can  *
    * include basic HTML tags, including links and images.                        *
    * Note: requires dhtmllib.js.                                                 *
    ******************************************************************************/
     
    //*****************************************************************************
    // Scroller constructor.
    //*****************************************************************************
     
    function Scroller(x, y, width, height, border, padding) {
     
      this.x = x;
      this.y = y;
      this.width = width;
      this.height = height;
      this.border = border;
      this.padding = padding;
     
      this.items = new Array();
      this.created = false;
     
      // Set default colors.
     
      this.fgColor = "#000000";
      this.bgColor = "#ffffff";
      this.bdColor = "#000000";
     
      // Set default font.
     
      this.fontFace = "Arial,Helvetica";
      this.fontSize = "2";
     
      // Set default scroll timing values.
     
      this.speed = 20;
      this.pauseTime = 2000;
     
      // Define methods.
     
      this.setColors = scrollerSetColors;
      this.setFont = scrollerSetFont;
      this.setSpeed = scrollerSetSpeed;
      this.setPause = scrollersetPause;
      this.addItem = scrollerAddItem;
      this.create = scrollerCreate;
      this.show = scrollerShow;
      this.hide = scrollerHide;
      this.moveTo = scrollerMoveTo;
      this.moveBy = scrollerMoveBy;
      this.getzIndex = scrollerGetzIndex;
      this.setzIndex = scrollerSetzIndex;
      this.stop = scrollerStop;
      this.start = scrollerStart;
    }
     
    //*****************************************************************************
    // Scroller methods.
    //*****************************************************************************
     
    function scrollerSetColors(fgcolor, bgcolor, bdcolor) {
     
      if (!this.created) {
        this.fgColor = fgcolor;
        this.bgColor = bgcolor;
        this.bdColor = bdcolor;
      }
    }
     
    function scrollerSetFont(face, size) {
     
      if (!this.created) {
        this.fontFace = face;
        this.fontSize = size;
      }
    }
     
    function scrollerSetSpeed(pps) {
     
      if (!this.created)
        this.speed = pps;
    }
     
    function scrollersetPause(ms) {
     
      if (!this.created)
        this.pauseTime = ms;
    }
     
    function scrollerAddItem(str) {
     
      if (!this.created)
        this.items[this.items.length] = str;
    }
     
    function scrollerCreate() {
     
      var start, end;
      var str;
      var i, j;
      var x, y;
     
     
      if (!isMinNS4 && !isMinIE4)
        return;
     
      // On first scroller, start interval timer.
     
      if (scrollerList.length == 0)
        setInterval('scrollerGo()', scrollerInterval);
     
      // Create the scroller only once.
     
      if (this.created)
        return;
      this.created = true;
     
      // Copy first item to the end of the list, this lets us scroll from the last
      // defined item to the first without jumping.
     
      this.items[this.items.length] = this.items[0];
     
      // Set up HTML code for item text.
     
      start = '<table border=0'
            + ' cellpadding=' + (this.padding + this.border) + ' cellspacing=0'
            + ' width=' + this.width + ' height=' + this.height + '>'
            + '<tr><td>'
            + '<font color="' + this.fgColor + '" face="' + this.fontFace + '"'
            + ' size=' + this.fontSize + '>';
      end   = '</font></td></tr></table>';
     
      // Build the layers.
     
      if (isMinNS4) {
        this.baseLayer = new Layer(this.width);
        this.scrollLayer = new Layer(this.width, this.baseLayer);
        this.scrollLayer.visibility = "inherit";
        this.itemLayers = new Array();
        for (i = 0; i < this.items.length; i++) {
          this.itemLayers[i] = new Layer(this.width, this.scrollLayer);
          this.itemLayers[i].document.open();
          this.itemLayers[i].document.writeln(start + this.items[i] + end);
          this.itemLayers[i].document.close();
          this.itemLayers[i].visibility = "inherit";
        }
     
        // Set background colors.
     
        setBgColor(this.baseLayer, this.bdColor);
        setBgColor(this.scrollLayer, this.bgColor);
      }
     
      if (isMinIE4) {
        i = scrollerList.length;
        str = '<div id="scroller' + i + '_baseLayer"'
            + ' style="position:absolute;'
            + 'left:0px; top:0px;'
            // + 'background-color:' + this.bdColor + ';'
            + 'width:' + this.width + 'px;'
            + 'height:' + this.height + 'px;'
            + 'overflow:hidden;'
            + 'visibility:hidden;">\n'
            + '<div id="scroller' + i + '_scrollLayer"'
            + ' style="position:absolute;'
            // + 'background-color: ' + this.bgColor + ';'
            + 'width:' + this.width + 'px;'
            + 'height:' + (this.height * this.items.length) + 'px;'
            + 'visibility:inherit;">\n';
        for (j = 0; j < this.items.length; j++) {
          str += '<div id="scroller' + i + '_itemLayer' + j + '"'
              +  ' style="position:absolute;'
              +  'width:' + this.width + 'px;'
              +  'height:' + this.height + 'px;'
              +  'visibility:inherit;">\n'
              +  start + this.items[j] + end
              +  '</div>\n';
        }
        str += '</div>\n'
            +  '</div>\n';
     
        // Insert HTML code at end of page. For IE4, need to scroll window to
        // end of page, insert and scroll back to correct bug.
     
        if (!isMinIE5) {
          x = getPageScrollX();
          y = getPageScrollY();
          window.scrollTo(getPageWidth(), getPageHeight());
        }
        document.body.insertAdjacentHTML("beforeEnd", str);
        if (!isMinIE5)
          window.scrollTo(x, y);
     
        // Get handles to each layer.
     
        this.baseLayer = getLayer("scroller" + i + "_baseLayer");
        this.scrollLayer = getLayer("scroller" + i + "_scrollLayer");
        this.itemLayers = new Array();
        for (j = 0; j < this.items.length; j++)
          this.itemLayers[j] = getLayer("scroller" + i + "_itemLayer" + j);
      }
     
      // Position and clip base and scroll layers.
     
      moveLayerTo(this.baseLayer, this.x, this.y);
      clipLayer(this.baseLayer, 0, 0, this.width, this.height);
      moveLayerTo(this.scrollLayer, this.border, this.border);
      clipLayer(this.scrollLayer, 0, 0,
                this.width - 2 * this.border, this.height - 2 * this.border);
     
      // Position and clip each item layer.
     
      x = 0;
      y = 0;
      for (i = 0; i < this.items.length; i++) {
        moveLayerTo(this.itemLayers[i], x, y);
        clipLayer(this.itemLayers[i], 0, 0, this.width, this.height);
        y += this.height;
      }
     
      // Set up scrolling parameters.
     
      this.stopped = false;
      this.currentY = 0;
      this.stepY = this.speed / (1000 / scrollerInterval);
      this.stepY = Math.min(this.height, this.stepY);
      this.nextY = this.height;
      this.maxY = this.height * (this.items.length - 1);
      this.paused = true;
      this.counter = 0;
     
      // Add to global list.
     
      scrollerList[scrollerList.length] = this;
     
      // Display it.
     
      showLayer(this.baseLayer);
    }
     
    function scrollerShow() {
     
      if (this.created)
        showLayer(this.baseLayer);
    }
     
    function scrollerHide() {
     
      if (this.created)
        hideLayer(this.baseLayer);
    }
     
    function scrollerMoveTo(x, y) {
     
      if (this.created)
        moveLayerTo(this.baseLayer, x, y);
    }
     
    function scrollerMoveBy(dx, dy) {
     
      if (this.created)
        moveLayerBy(this.baseLayer, dx, dy);
    }
     
    function scrollerGetzIndex() {
     
      if (this.created)
        return(getzIndex(this.baseLayer));
      else
        return(0);
    }
     
    function scrollerSetzIndex(z) {
     
      if (this.created)
        setzIndex(this.baseLayer, z);
    }
     
    function scrollerStart() {
     
      this.stopped = false;
    }
     
    function scrollerStop() {
     
      this.stopped = true;
    }
     
     
    //*****************************************************************************
    // Code for scrolling.
    //*****************************************************************************
     
    // An array is used to hold a pointer to each scroller that is defined. The
    // scrollerGo() function runs at regular intervals and updates each scroller
    // in this list.
     
    var scrollerList     = new Array();
    var scrollerInterval = 20;
     
    function scrollerGo() {
     
      var i;
     
      // Update each scroller object in the list.
     
      for (i = 0; i < scrollerList.length; i++) {
     
        // If stopped, skip.
     
        if (scrollerList[i].stopped);
     
        // If paused, update counter.
     
        else if (scrollerList[i].paused) {
          scrollerList[i].counter += scrollerInterval;
          if (scrollerList[i].counter > scrollerList[i].pauseTime)
            scrollerList[i].paused = false;
        }
     
        // Scroll it.
     
        else {
          scrollerList[i].currentY += scrollerList[i].stepY;
     
          // Pause it if the next item has scrolled into view.
     
          if (scrollerList[i].currentY >= scrollerList[i].nextY) {
            scrollerList[i].paused = true;
            scrollerList[i].counter = 0;
            scrollerList[i].currentY = scrollerList[i].nextY;
            scrollerList[i].nextY += scrollerList[i].height;
          }
     
          // When we reach the end, start over.
     
          if (scrollerList[i].currentY >= scrollerList[i].maxY) {
            scrollerList[i].currentY -= scrollerList[i].maxY;
            scrollerList[i].nextY = scrollerList[i].height;
          }
          scrollLayerTo(scrollerList[i].scrollLayer,
                        0, Math.round(scrollerList[i].currentY),
                        false);
        }
      }
    }
     
    //*****************************************************************************
    // Code to handle a window resize.
    //*****************************************************************************
     
    // These variables are used to determine if a resize event is a true one in
    // older releases of NS4.
     
    var origWidth;
    var origHeight;
     
    // Reload page in case of a browser resize.
     
    if (isMinNS4) {
      origWidth  = window.innerWidth;
      origHeight = window.innerHeight;
    }
    window.onresize = scrollerReload;
     
    function scrollerReload() {
     
      if (isMinNS4 && origWidth == window.innerWidth && origHeight == window.innerHeight)
        return;
     
      // For IE, reload on a timer in case the Windows 'Show window contents while
      // dragging' display option is on.
     
      if (isMinIE4)
        setTimeout('window.location.href = window.location.href', 2000);
      else
        window.location.href = window.location.href;
    }
     
    </SCRIPT>
    <SCRIPT language=JavaScript >
     
    /******************************************************************************
    * dhtmllib.js                                                                 *
    *                                                                             *
    * Copyright 1999 by Mike Hall.                                                *
    * Web address: <a href="http://www.brainjar.com" target="_blank">http://www.brainjar.com</a>                                        *
    * Last update: February 26, 2000.                                             *
    *                                                                             *
    * Provides basic functions for DHTML positioned elements which will work on   *
    * both Netscape Communicator and Internet Explorer browsers (version 4.0 and  *
    * up).                                                                        *
    ******************************************************************************/
     
    // Determine browser.
     
    var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
                   parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
    var isMinIE4 = (document.all) ? 1 : 0;
    var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;
     
    //-----------------------------------------------------------------------------
    // Layer visibility.
    //-----------------------------------------------------------------------------
     
    function hideLayer(layer) {
     
      if (isMinNS4)
        layer.visibility = "hide";
      if (isMinIE4)
        layer.style.visibility = "hidden";
    }
     
    function showLayer(layer) {
     
      if (isMinNS4)
        layer.visibility = "show";
      if (isMinIE4)
        layer.style.visibility = "visible";
    }
     
    function inheritLayer(layer) {
     
      if (isMinNS4)
        layer.visibility = "inherit";
      if (isMinIE4)
        layer.style.visibility = "inherit";
    }
     
    function getVisibility(layer) {
     
      if (isMinNS4) {
        if (layer.visibility == "show")
          return "visible";
        if (layer.visibility == "hide")
          return "hidden";
        return layer.visibility;
      }
      if (isMinIE4)
        return layer.style.visibility;
      return "";
    }
     
    //-----------------------------------------------------------------------------
    // Layer positioning.
    //-----------------------------------------------------------------------------
     
    function moveLayerTo(layer, x, y) {
     
      if (isMinNS4)
        layer.moveTo(x, y);
      if (isMinIE4) {
        layer.style.left = x;
        layer.style.top  = y;
      }
    }
     
    function moveLayerBy(layer, dx, dy) {
     
      if (isMinNS4)
        layer.moveBy(dx, dy);
      if (isMinIE4) {
        layer.style.pixelLeft += dx;
        layer.style.pixelTop  += dy;
      }
    }
     
    function getLeft(layer) {
     
      if (isMinNS4)
        return layer.left;
      if (isMinIE4)
        return layer.style.pixelLeft;
      return -1;
    }
     
    function getTop(layer) {
     
      if (isMinNS4)
        return layer.top;
      if (isMinIE4)
        return layer.style.pixelTop;
      return -1;
    }
     
    function getRight(layer) {
     
      if (isMinNS4)
        return layer.left + getWidth(layer);
      if (isMinIE4)
        return layer.style.pixelLeft + getWidth(layer);
      return -1;
    }
     
    function getBottom(layer) {
     
      if (isMinNS4)
        return layer.top + getHeight(layer);
      if (isMinIE4)
        return layer.style.pixelTop + getHeight(layer);
      return -1;
    }
     
    function getPageLeft(layer) {
     
      var x;
     
      if (isMinNS4)
        return layer.pageX;
      if (isMinIE4) {
        x = 0;
        while (layer.offsetParent != null) {
          x += layer.offsetLeft;
          layer = layer.offsetParent;
        }
        x += layer.offsetLeft;
        return x;
      }
      return -1;
    }
     
    function getPageTop(layer) {
     
      var y;
     
      if (isMinNS4)
        return layer.pageY;
      if (isMinIE4) {
        y = 0;
        while (layer.offsetParent != null) {
          y += layer.offsetTop;
          layer = layer.offsetParent;
        }
        y += layer.offsetTop;
        return y;
      }
      return -1;
    }
     
    function getWidth(layer) {
     
      if (isMinNS4) {
        if (layer.document.width)
          return layer.document.width;
        else
          return layer.clip.right - layer.clip.left;
      }
      if (isMinIE4) {
        if (layer.style.pixelWidth)
          return layer.style.pixelWidth;
        else
          return layer.clientWidth;
      }
      return -1;
    }
     
    function getHeight(layer) {
     
      if (isMinNS4) {
        if (layer.document.height)
          return layer.document.height;
        else
          return layer.clip.bottom - layer.clip.top;
      }
      if (isMinIE4) {
        if (layer.style.pixelHeight)
          return layer.style.pixelHeight;
        else
          return layer.clientHeight;
      }
      return -1;
    }
     
    function getzIndex(layer) {
     
      if (isMinNS4)
        return layer.zIndex;
      if (isMinIE4)
        return layer.style.zIndex;
     
      return -1;
    }
     
    function setzIndex(layer, z) {
     
      if (isMinNS4)
        layer.zIndex = z;
      if (isMinIE4)
        layer.style.zIndex = z;
    }
     
    //-----------------------------------------------------------------------------
    // Layer clipping.
    //-----------------------------------------------------------------------------
     
    function clipLayer(layer, clipleft, cliptop, clipright, clipbottom) {
     
      if (isMinNS4) {
        layer.clip.left   = clipleft;
        layer.clip.top    = cliptop;
        layer.clip.right  = clipright;
        layer.clip.bottom = clipbottom;
      }
      if (isMinIE4)
        layer.style.clip = 'rect(' + cliptop + ' ' +  clipright + ' ' + clipbottom + ' ' + clipleft +')';
    }
     
    function getClipLeft(layer) {
     
      if (isMinNS4)
        return layer.clip.left;
      if (isMinIE4) {
        var str =  layer.style.clip;
        if (!str)
          return 0;
        var clip = getIEClipValues(layer.style.clip);
        return(clip[3]);
      }
      return -1;
    }
     
    function getClipTop(layer) {
     
      if (isMinNS4)
        return layer.clip.top;
      if (isMinIE4) {
        var str =  layer.style.clip;
        if (!str)
          return 0;
        var clip = getIEClipValues(layer.style.clip);
        return clip[0];
      }
      return -1;
    }
     
    function getClipRight(layer) {
     
      if (isMinNS4)
        return layer.clip.right;
      if (isMinIE4) {
        var str =  layer.style.clip;
        if (!str)
          return layer.style.pixelWidth;
        var clip = getIEClipValues(layer.style.clip);
        return clip[1];
      }
      return -1;
    }
     
    function getClipBottom(layer) {
     
      if (isMinNS4)
        return layer.clip.bottom;
      if (isMinIE4) {
        var str =  layer.style.clip;
        if (!str)
          return layer.style.pixelHeight;
        var clip = getIEClipValues(layer.style.clip);
        return clip[2];
      }
      return -1;
    }
     
    function getClipWidth(layer) {
     
      if (isMinNS4)
        return layer.clip.width;
      if (isMinIE4) {
        var str = layer.style.clip;
        if (!str)
          return layer.style.pixelWidth;
        var clip = getIEClipValues(layer.style.clip);
        return clip[1] - clip[3];
      }
      return -1;
    }
     
    function getClipHeight(layer) {
     
      if (isMinNS4)
        return layer.clip.height;
      if (isMinIE4) {
        var str =  layer.style.clip;
        if (!str)
          return layer.style.pixelHeight;
        var clip = getIEClipValues(layer.style.clip);
        return clip[2] - clip[0];
      }
      return -1;
    }
     
    function getIEClipValues(str) {
     
      var clip = new Array();
      var i;
     
      // Parse out the clipping values for IE layers.
     
      i = str.indexOf("(");
      clip[0] = parseInt(str.substring(i + 1, str.length), 10);
      i = str.indexOf(" ", i + 1);
      clip[1] = parseInt(str.substring(i + 1, str.length), 10);
      i = str.indexOf(" ", i + 1);
      clip[2] = parseInt(str.substring(i + 1, str.length), 10);
      i = str.indexOf(" ", i + 1);
      clip[3] = parseInt(str.substring(i + 1, str.length), 10);
      return clip;
    }
     
    //-----------------------------------------------------------------------------
    // Layer scrolling.
    //-----------------------------------------------------------------------------
     
    function scrollLayerTo(layer, x, y, bound) {
     
      var dx = getClipLeft(layer) - x;
      var dy = getClipTop(layer) - y;
     
      scrollLayerBy(layer, -dx, -dy, bound);
    }
     
    function scrollLayerBy(layer, dx, dy, bound) {
     
      var cl = getClipLeft(layer);
      var ct = getClipTop(layer);
      var cr = getClipRight(layer);
      var cb = getClipBottom(layer);
     
      if (bound) {
        if (cl + dx < 0)
          dx = -cl;
        else if (cr + dx > getWidth(layer))
          dx = getWidth(layer) - cr;
        if (ct + dy < 0)
          dy = -ct;
        else if (cb + dy > getHeight(layer))
          dy = getHeight(layer) - cb;
      }
      clipLayer(layer, cl + dx, ct + dy, cr + dx, cb + dy);
      moveLayerBy(layer, -dx, -dy);
    }
     
    //-----------------------------------------------------------------------------
    // Layer background.
    //-----------------------------------------------------------------------------
     
    function setBgColor(layer, color) {
     
      if (isMinNS4)
        layer.bgColor = color;
      if (isMinIE4)
        layer.style.backgroundColor = color;
    }
     
    function setBgImage(layer, src) {
     
      if (isMinNS4)
        layer.background.src = src;
      if (isMinIE4)
        layer.style.backgroundImage = "url(" + src + ")";
    }
     
    //-----------------------------------------------------------------------------
    // Layer utilities.
    //-----------------------------------------------------------------------------
     
    function getLayer(name) {
     
      if (isMinNS4)
        return findLayer(name, document);
      if (isMinIE4)
        return eval('document.all.' + name);
      return null;
    }
     
    function findLayer(name, doc) {
     
      var i, layer;
     
      for (i = 0; i < doc.layers.length; i++) {
        layer = doc.layers[i];
        if (layer.name == name)
          return layer;
        if (layer.document.layers.length > 0)
          if ((layer = findLayer(name, layer.document)) != null)
            return layer;
      }
      return null;
    }
     
    //-----------------------------------------------------------------------------
    // Image utilities.
    //-----------------------------------------------------------------------------
     
    function getImage(name) { //OK
     
     //alert(name);
      if (isMinNS4) {
        return findImage(name, document);
      }
      if (isMinIE4)
        return eval('document.all.' + name);
      return null;
    }
     
    function findImage(name, doc) { //OK
     
      var i, img;
     
      for (i = 0; i < doc.images.length; i++)
        if (doc.images[i].name == name)
          return doc.images[i];
      for (i = 0; i < doc.layers.length; i++)
        if ((img = findImage(name, doc.layers[i].document)) != null) {
          img.container = doc.layers[i];
          return img;
        }
      return null;
    }
     
    function getImagePageLeft(img) { //OK
     
      var x, obj;
     
      if (isMinNS4) {
        if (img.container != null)
          return img.container.pageX + img.x;
        else
          return img.x;
      }
      if (isMinIE4) {
        x = 0;
        obj = img;
        while (obj.offsetParent != null) {
          x += obj.offsetLeft;
          obj = obj.offsetParent;
        }
        x += obj.offsetLeft;
        return x;
      }
      return -1;
    }
     
    function getImagePageTop(img) { //OK
     
      var y, obj;
     
      if (isMinNS4) {
        if (img.container != null)
          return img.container.pageY + img.y;
        else
          return img.y;
      }
      if (isMinIE4) {
        y = 0;
        obj = img;
        while (obj.offsetParent != null) {
          y += obj.offsetTop;
          obj = obj.offsetParent;
        }
        y += obj.offsetTop;
        return y;
      }
      return -1;
    }
     
    //-----------------------------------------------------------------------------
    // Window and page properties.
    //-----------------------------------------------------------------------------
     
    function getWindowWidth() {
     
      if (isMinNS4)
        return window.innerWidth;
      if (isMinIE4)
        return document.body.clientWidth;
      return -1;
    }
     
    function getWindowHeight() {
     
      if (isMinNS4)
        return window.innerHeight;
      if (isMinIE4)
        return document.body.clientHeight;
      return -1;
    }
     
    function getPageWidth() {
     
      if (isMinNS4)
        return document.width;
      if (isMinIE4)
        return document.body.scrollWidth;
      return -1;
    }
     
    function getPageHeight() {
     
      if (isMinNS4)
        return document.height;
      if (isMinIE4)
        return document.body.scrollHeight;
      return -1;
    }
     
    function getPageScrollX() {
     
      if (isMinNS4)
        return window.pageXOffset;
      if (isMinIE4)
        return document.body.scrollLeft;
      return -1;
    }
     
    function getPageScrollY() {
     
      if (isMinNS4)
        return window.pageYOffset;
      if (isMinIE4)
        return document.body.scrollTop;
      return -1;
    }
     
    </SCRIPT>
     
    <SCRIPT language=JavaScript>
    var myScroller1 = new Scroller(0, 1, 158,194, 0, 0);
    myScroller1.setColors("#000000", "#FFFFFF", "#00005B");
    myScroller1.setFont("Helvetica,Arial", 1);
    myScroller1.setSpeed(500);
    myScroller1.setPause(1500);
    myScroller1.addItem("<a href='?page=programmes_neufs&id_rubrique=10&id_article=2' target='_parent'><img border=0 height=198 width=158 src='squelettes/images/Diapo1.png'>");
    myScroller1.addItem("<a href='?page=programmes_neufs&id_rubrique=11&id_article=4'  target='_parent'><img border=0 height=198 width=158 src='squelettes/images/Diapo2.png'>");
    myScroller1.addItem("<a href='?page=bienavendre&id_groupe=2&id_rubrique=12&id_article=7&T1=&T2=2&T3=&T4=' target='_parent'><img border=0 height=198 width=158 src='squelettes/images/Diapo3.png'>");
    myScroller1.addItem("<a href='?page=bienavendre&id_groupe=3&id_rubrique=21&id_article=22' target='_parent'><img border=0 height=198 width=158 src='squelettes/images/Diapo4.png'>");
     
    function runscroll() {
     
     //alert("hiii");
      var layer;
      var scrollx, scrolly;
      // Locate placeholder img so we can use it to position the scrollers.
      layer = getImage("placeholder");
      scrollx = getImagePageLeft(layer);
      scrolly = getImagePageTop(layer);
      // Create the first scroller and position it.
      myScroller1.create();
      myScroller1.hide();
      myScroller1.moveTo(scrollx, scrolly);
      //myScroller1.moveTo(100, 100);
      myScroller1.setzIndex(100);
      myScroller1.show();
    }
    //window.onload=runscroll
    StkFunc(runscroll);
    </SCRIPT>
    <img height=192 src="squelettes/Lib/transparent.gif" width=156  border=0 name="placeholder">
    </DIV>
    </BODY>

  4. #4
    Expert éminent sénior

    Homme Profil pro
    Inscrit en
    Janvier 2007
    Messages
    13 474
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations professionnelles :
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2007
    Messages : 13 474
    Points : 36 571
    Points
    36 571
    Par défaut
    Bonjour,
    passe déjà tes parties <script> et <style> dans le <head> de la page ...

    A+

  5. #5
    Membre du Club
    Inscrit en
    Janvier 2008
    Messages
    97
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 97
    Points : 42
    Points
    42
    Par défaut
    Bonjour,

    j'utilise spip comme CMS, donc je crée un article qui contient mon code,et je fait appel à cet article.les images se déffilent sans probleme, je veux seulement ajouter un texte au dessus des images du diaporama.

  6. #6
    Membre régulier
    Profil pro
    Inscrit en
    Décembre 2007
    Messages
    63
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2007
    Messages : 63
    Points : 73
    Points
    73
    Par défaut
    salut

    Quand tu dis au dessus de l'image , c'est au dessus , ou sur l'image ? Car si c'est sur , tu peux mettre du texte sur l'image en utilisant du css , ou la librairie GD de php (mais là ca tourne côté serveur donc va falloir que tu utilises des XMLHttpRequest , ou de l'ajax pour afficher l'image). Sinon , si c'est juste au dessus , tu fais simplement une div ou un endroit où tu pourras modifier l'innerHTML

  7. #7
    Membre émérite
    Inscrit en
    Septembre 2002
    Messages
    2 307
    Détails du profil
    Informations forums :
    Inscription : Septembre 2002
    Messages : 2 307
    Points : 2 814
    Points
    2 814
    Par défaut
    utilise l'attribut
    title

  8. #8
    Membre du Club
    Inscrit en
    Janvier 2008
    Messages
    97
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 97
    Points : 42
    Points
    42
    Par défaut
    Bonjour,


    j ai tester avec l'attribut "title", c'est pas ça mon but,merci comme même.

    d'aprés mon code y t il pas une possibilité d'ecrire un texte sur les images qui déffilent,voilà comment je fait appel à mon code:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <td colspan="2">  
        <iframe  marginheight="0" marginwidth="0" frameborder="0" scrolling="no" width="162" height="198" src="News.html"></iframe>
    </td>
    sachant que News.html contient le code que j ai posté au début.


    merci de votre aide .


    trés cordialemnt.

  9. #9
    Membre du Club
    Inscrit en
    Janvier 2008
    Messages
    97
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 97
    Points : 42
    Points
    42
    Par défaut
    Bonjour,

    Svp j'attends votre aide, je suis bloqué là

    Trés cordialement

  10. #10
    Membre averti
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2007
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Transports

    Informations forums :
    Inscription : Février 2007
    Messages : 340
    Points : 350
    Points
    350
    Par défaut
    Tu fais un DIV avec un position:absolute que tu positionnes en X et Y sur l'image

    Fait une recherche sur le CSS position et tu trouveras ton bonheur pour placer une balise ou tu veux.
    Après si le texte se met sous l'image, il faut regarder du coté du zindex

  11. #11
    Membre émérite
    Inscrit en
    Septembre 2002
    Messages
    2 307
    Détails du profil
    Informations forums :
    Inscription : Septembre 2002
    Messages : 2 307
    Points : 2 814
    Points
    2 814

  12. #12
    Membre du Club
    Inscrit en
    Janvier 2008
    Messages
    97
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 97
    Points : 42
    Points
    42
    Par défaut
    Bonjour,

    Merci pour vous tous .

    voilà la solution:
    dans mon code javascript déjà cité, j'ai ajouté un div comme suit:


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    // Set up HTML code for item text.
    
      start = '<div style="position:absolute;top:170px;left:4px;'
             + ' font-weight:bold; width:180px;color:#FFFFFF; font-size:12;'
             + ' font-family:Arial, Helvetica, sans-serif">'
             + ' test test test</div>'         + '<table border=0'
            + ' cellpadding=' + (this.padding + this.border) + ' cellspacing=0'
            + ' width=' + this.width + ' height=' + this.height + '>'
            + '<tr><td>'
            + '<font color="' + this.fgColor + '" face="' + this.fontFace + '"'
            + ' size=' + this.fontSize + '>' ;
      end   = '</font></td></tr></table>';

  13. #13
    Membre averti
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2007
    Messages
    340
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Transports

    Informations forums :
    Inscription : Février 2007
    Messages : 340
    Points : 350
    Points
    350
    Par défaut
    Merci de mettre une balise [ CODE ] lorsque tu insère du code dans ton post

    Sinon oui c'est bien de ça que je parlais

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

Discussions similaires

  1. Ecrire du texte sur une image
    Par Anduriel dans le forum Interfaces Graphiques en Java
    Réponses: 2
    Dernier message: 08/04/2013, 19h24
  2. Améliorer l'impression de texte sur les images
    Par Montor dans le forum Contribuez
    Réponses: 0
    Dernier message: 14/04/2010, 22h27
  3. ecrire un texte sur une image
    Par marcel marie dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 12/02/2009, 11h12
  4. Ecrire du texte sur une image
    Par Goofyjp dans le forum Composants VCL
    Réponses: 2
    Dernier message: 11/11/2008, 00h26

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