Partage
  • Partager sur Facebook
  • Partager sur Twitter

Script d'apparition de div...

Sa veut pas marché :(

    18 janvier 2009 à 13:30:26

    s="nx">inDiv.innerHTML = "<b><u>Disparition dans :</u> " + newWrite + " sec</b>";                                                 tx--;                                                 inWrite--;                                                 setTimeout('defileContent("' + test + '", ' + tr + ', ' + tx + ', ' + time + ', ' + count + ', ' + inWrite + ')',100);                                         }                                 }                         }                 </SCRIPT>                 var inDiv = document.getElementById(test + '_id');                                 if(count < time)                                 {                                         if(tr < 100)                                         {                                                 if(tr == 0)                                                 {                                                         div.style.display = "block";                                                 }                                                                                                  var tf = tr / 100;                                                 div.style.opacity = tf;                                                 div.style.filter = "alpha(opacity=" + tr + ")";                                                                                                  inDiv.style.opacity = tf;                                                 inDiv.style.filter = "alpha(opacity=" + tr + ")";                                                                                                  div.innerHTML = "<br />Opacity : " + tr        + " / " + tf + " sur 100 / 1 ~~ " + count + " sur " + time;                                                 var newWrite = inWrite / 10;                                                 inDiv.innerHTML = "<b><u>Disparition dans :</u> " + newWrite + " sec</b>";                                                 tr++;                                                 count++;                                                 inWrite--;                                                 setTimeout('defileContent("' + test + '", ' + tr + ', ' + tx + ', ' + time + ', ' + count + ', ' + inWrite + ')',100);                                         }                                         else                                         {                                                 div.innerHTML = "<br />Opacity : 100 / 1 sur 100 / 1 ~~ Compteur : " + count + " sur " + time;                                                 var newWrite = inWrite / 10;                                                 inDiv.innerHTML = "<b><u>Disparition dans :</u> " + newWrite + " sec</b>";                                                 count++;                                                 inWrite--;                                                 setTimeout('defileContent("' + test + '", ' + tr + ', ' + tx + ', ' + time + ', ' + count + ', ' + inWrite + ')',100);                                         }                                 }                                 else if(count == time)                                 {                                         if(tx <= 100)                                         {                                                 if(tx == 0)                                                 {                                                         div.style.display = "none";                                                 }                                                                                                  var ty = tx / 100;                                                 div.style.opacity = ty;                                                 div.style.filter = "alpha(opacity=" + tx + ")";                                                                                                  inDiv.style.opacity = ty;                                                 inDiv.style.filter = "alpha(opacity=" + tx + ")";                                                                                                  div.innerHTML = "<br />Opacity : " + tx + " / " + ty + " sur 0 / 0";                                                 var newWrite = inWrite / 10;                                                 
    • Partager sur Facebook
    • Partager sur Twitter
    Creative Community & Innovation : http://cc-i.ovh
      18 janvier 2009 à 15:09:33

      Tu peux nous mettre également l'html qui l'utilise et l'appel de la fonction ?
      • Partager sur Facebook
      • Partager sur Twitter
        18 janvier 2009 à 17:18:49

        �                          inDiv.style.display = "none";                                         clearTimeout('defileContent("' + test + '", 100, 100, 0, 0, 0,"off")');                                 }                         }                 </SCRIPT>

        Si vous trouver une facon pour enlevé pas que le switch sois si long je suis prenneur :)

        Div + affichage :
        <a href="#" onclick="javascript:defileContent('content',0,100,600,0,700,'on');">Encore un simple test de titre un peu plus long :)</a><span id="content_id"></span> // <a href="#" onclick="javascript:defileContent('content',0,100,600,0,700,'off');">Cacher</a></span>


        �                      case 29: div.style.background = "rgb(73,73,73)"; break;                                                                 case 30: div.style.background = "rgb(76,76,76)"; break;                                                                 case 31: div.style.background = "rgb(78,78,78)"; break;                                                                 case 32: div.style.background = "rgb(80,80,80)"; break;                                                                 case 33: div.style.background = "rgb(83,83,83)"; break;                                                                 case 34: div.style.background = "rgb(86,86,86)"; break;                                                                 case 35: div.style.background = "rgb(88,88,88)"; break;                                                                 case 36: div.style.background = "rgb(90,90,90)"; break;                                                                 case 37: div.style.background = "rgb(93,93,93)"; break;                                                                 case 38: div.style.background = "rgb(96,96,96)"; break;                                                                 case 39: div.style.background = "rgb(98,98,98)"; break;                                                                 case 40: div.style.background = "rgb(100,100,100)"; break;                                                                 case 41: div.style.background = "rgb(103,103,103)"; break;                                                                 case 42: div.style.background = "rgb(106,106,106)"; break;                                                                 case 43: div.style.background = "rgb(108,108,108)"; break;                                                                 case 44: div.style.background = "rgb(110,110,110)"; break;                                                                 case 45: div.style.background = "rgb(113,113,113)"; break;                                                                 case 46: div.style.background = "rgb(116,116,116)"; break;                                                                 case 47: div.style.background = "rgb(118,118,118)"; break;                                                                 case 48: div.style.background = "rgb(120,120,120)"; break;                                                                 case 49: div.style.background = "rgb(123,123,123)"; break;                                                                 case 50: div.style.background = "rgb(126,126,126)"; break;                                                                 case 51: div.style.background = "rgb(128,128,128)"; break;                                                                 case 52: div.style.background = "rgb(130,130,130)"; break;                                                                 case 53: div.style.background = "rgb(133,133,133)"; break;                                                                 case 54: div.style.background = "rgb(136,136,136)"; break;                                                                 case 55: div.style.background = "rgb(138,138,138)"; break;                                                                 case 56: div.style.background = "rgb(140,140,140)"; break;                                                                 case 57: div.style.background = "rgb(143,143,143)"; break;                                                                 case 58: div.style.background = "rgb(146,146,146)"; break;                                                                 case 59: div.style.background = "rgb(148,148,148)"; break;                                                                 case 60: div.style.background = "rgb(150,150,150)"; break;                                                                 case 61: div.style.background = "rgb(153,153,153)"; break;                                                                 case 62: div.style.background = "rgb(156,156,156)"; break;                                                                 case 63: div.style.background = "rgb(158,158,158)"; break;                                                                 case 64: div.style.background = "rgb(160,160,160)"; break;                                                                 case 65: div.style.background = "rgb(163,163,163)"; break;                                                                 case 66: div.style.background = "rgb(166,166,166)"; break;                                                                 case 67: div.style.background = "rgb(168,168,168)"; break;                                                                 case 68: div.style.background = "rgb(170,170,170)"; break;                                                                 case 69: div.style.background = "rgb(173,173,173)"; break;                                                                 case 70: div.style.background = "rgb(176,176,176)"; break;                                                                 case 71: div.style.background = "rgb(178,178,178)"; break;                                                                 case 72: div.style.background = "rgb(180,180,180)"; break;                                                                 case 73: div.style.background = "rgb(183,183,183)"; break;                                                                 case 74: div.style.background = "rgb(186,186,186)"; break;                                                                 case 75: div.style.background = "rgb(188,188,188)"; break;                                                                 case 76: div.style.background = "rgb(190,190,190)"; break;                                                                 case 77: div.style.background = "rgb(193,193,193)"; break;                                                                 case 78: div.style.background = "rgb(196,196,196)"; break;                                                                 case 79: div.style.background = "rgb(198,198,198)"; break;                                                                 case 80: div.style.background = "rgb(200,200,200)"; break;                                                                 case 81: div.style.background = "rgb(203,203,203)"; break;                                                                 case 82: div.style.background = "rgb(206,206,206)"; break;                                                                 case 83: div.style.background = "rgb(208,208,208)"; break;                                                                 case 84: div.style.background = "rgb(210,210,210)"; break;                                                                 case 85: div.style.background = "rgb(213,213,213)"; break;                                                                 case 86: div.style.background = "rgb(216,216,216)"; break;                                                                 case 87: div.style.background = "rgb(218,218,218)"; break;                                                                 case 88: div.style.background = "rgb(220,220,220)"; break;                                                                 case 89: div.style.background = "rgb(223,223,223)"; break;                                                                 case 90: div.style.background = "rgb(226,226,226)"; break;                                                                 case 91: div.style.background = "rgb(228,228,228)"; break;                                                                 case 92: div.style.background = "rgb(230,230,230)"; break;                                                                 case 93: div.style.background = "rgb(233,233,233)"; break;                                                                 case 94: div.style.background = "rgb(236,236,236)"; break;                                                                 case 95: div.style.background = "rgb(238,238,238)"; break;                                                                 case 96: div.style.background = "rgb(240,240,240)"; break;                                                                 case 97: div.style.background = "rgb(243,243,243)"; break;                                                                 case 98: div.style.background = "rgb(246,246,246)"; break;                                                                 case 99: div.style.background = "rgb(249,249,249)"; break;                                                                 case 100: div.style.background = "rgb(255,255,255)"; break;                                                         }                                                                                                                                  tx--;                                                                 inWrite--;                                                                 setTimeout('defileContent("' + test + '", ' + tr + ', ' + tx + ', ' + time + ', ' + count + ', ' + inWrite + ',"on")',100);                                                         }                                                 }                                         }                                 }                                 else if(actif == "off")                                 {                                         div.style.display = "none";              �;                                                                 case 64: div.style.background = "rgb(160,160,160)"; break;                                                                 case 65: div.style.background = "rgb(163,163,163)"; break;                                                                 case 66: div.style.background = "rgb(166,166,166)"; break;                                                                 case 67: div.style.background = "rgb(168,168,168)"; break;                                                                 case 68: div.style.background = "rgb(170,170,170)"; break;                                                                 case 69: div.style.background = "rgb(173,173,173)"; break;                                                                 case 70: div.style.background = "rgb(176,176,176)"; break;                                                                 case 71: div.style.background = "rgb(178,178,178)"; break;                                                                 case 72: div.style.background = "rgb(180,180,180)"; break;                                                                 case 73: div.style.background = "rgb(183,183,183)"; break;                                                                 case 74: div.style.background = "rgb(186,186,186)"; break;                                                                 case 75: div.style.background = "rgb(188,188,188)"; break;                                                                 case 76: div.style.background = "rgb(190,190,190)"; break;                                                                 case 77: div.style.background = "rgb(193,193,193)"; break;                                                                 case 78: div.style.background = "rgb(196,196,196)"; break;                                                                 case 79: div.style.background = "rgb(198,198,198)"; break;                                                                 case 80: div.style.background = "rgb(200,200,200)"; break;                                                                 case 81: div.style.background = "rgb(203,203,203)"; break;                                                                 case 82: div.style.background = "rgb(206,206,206)"; break;                                                                 case 83: div.style.background = "rgb(208,208,208)"; break;                                                                 case 84: div.style.background = "rgb(210,210,210)"; break;                                                                 case 85: div.style.background = "rgb(213,213,213)"; break;                                                                 case 86: div.style.background = "rgb(216,216,216)"; break;                                                                 case 87: div.style.background = "rgb(218,218,218)"; break;                                                                 case 88: div.style.background = "rgb(220,220,220)"; break;                                                                 case 89: div.style.background = "rgb(223,223,223)"; break;                                                                 case 90: div.style.background = "rgb(226,226,226)"; break;                                                                 case 91: div.style.background = "rgb(228,228,228)"; break;                                                                 case 92: div.style.background = "rgb(230,230,230)"; break;                                                                 case 93: div.style.background = "rgb(233,233,233)"; break;                                                                 case 94: div.style.background = "rgb(236,236,236)"; break;                                                                 case 95: div.style.background = "rgb(238,238,238)"; break;                                                                 case 96: div.style.background = "rgb(240,240,240)"; break;                                                                 case 97: div.style.background = "rgb(243,243,243)"; break;                                                                 case 98: div.style.background = "rgb(246,246,246)"; break;                                                                 case 99: div.style.background = "rgb(249,249,249)"; break;                                                                 case 100: div.style.background = "rgb(255,255,255)"; break;                                                         }                                                                                                                  tr++;                                                         count++;                                                         inWrite--;                                                         setTimeout('defileContent("' + test + '", ' + tr + ', ' + tx + ', ' + time + ', ' + count + ', ' + inWrite + ',"on")',100);                                                 }                                                 else                                                 {                                                         count++;                                                         inWrite--;                                                         div.style.background = "rgb(255,255,255);";                                                         setTimeout('defileContent("' + test + '", ' + tr + ', ' + tx + ', ' + time + ', ' + count + ', ' + inWrite + ',"on")',100);                                                 }                                         }                                         else if(count == time)                                         {                                                 if( (tx == 0) && (inWrite == 0) )                                                 {                                                         div.style.display = "none";                                                         inDiv.style.display = "none";                                                         clearTimeout('defileContent("' + test + '", 100, 100, ' + time + ', ' + count + ', ' + inWrite + ',"off")');                                                 }                                                 else                                                 {                                                         if(tx <= 100)                                                         {                                                                 var ty = tx / 100;                                                                 div.style.opacity = ty;                                                                 div.style.filter = "alpha(opacity=" + tx + ")";                                                                                                                                  inDiv.style.opacity = ty;                                                                 inDiv.style.filter = "alpha(opacity=" + tx + ")";                                                                                                                          switch(tx)                                                         {                                                                 case 0: div.style.background = "rgb(0,0,0)"; break;                                                                 case 1: div.style.background = "rgb(3,3,3)"; break;                                                                 case 2: div.style.background = "rgb(6,6,6)"; break;                                                                 case 3: div.style.background = "rgb(8,8,8)"; break;                                                                 case 4: div.style.background = "rgb(10,10,10)"; break;                                                                 case 5: div.style.background = "rgb(13,13,13)"; break;                                                                  case 6: div.style.background = "rgb(16,16,16)"; break;                                                                 case 7: div.style.background = "rgb(18,18,18)"; break;                                                                 case 8: div.style.background = "rgb(20,20,20)"; break;                                                                 case 9: div.style.background = "rgb(23,23,23)"; break;                                                                 case 10: div.style.background = "rgb(26,26,26)"; break;                                                                 case 11: div.style.background = "rgb(28,28,28)"; break;                                                                 case 12: div.style.background = "rgb(30,30,30)"; break;                                                                 case 13: div.style.background = "rgb(33,33,33)"; break;                                                                 case 14: div.style.background = "rgb(36,36,36)"; break;                                                                 case 15: div.style.background = "rgb(38,38,38)"; break;                                                                 case 16: div.style.background = "rgb(40,40,40)"; break;                                                                 case 17: div.style.background = "rgb(43,43,43)"; break;                                                                 case 18: div.style.background = "rgb(46,46,46)"; break;                                                                 case 19: div.style.background = "rgb(48,48,48)"; break;                                                                 case 20: div.style.background = "rgb(50,50,50)"; break;                                                                 case 21: div.style.background = "rgb(53,53,53)"; break;                                                                 case 22: div.style.background = "rgb(56,56,56)"; 
        • Partager sur Facebook
        • Partager sur Twitter
        Creative Community & Innovation : http://cc-i.ovh
          18 janvier 2009 à 18:46:51

          div.style.background = "rgb("+tr*3+","+tr*3+","+tr*3+")"
          • Partager sur Facebook
          • Partager sur Twitter
            18 janvier 2009 à 21:29:59

            Pourquoi tu fait pas un boucle avec des if ?
            • Partager sur Facebook
            • Partager sur Twitter
              19 janvier 2009 à 18:37:08

              Parce que sa marcherais pas avec sa :

              c'est : 00 ; 03 ; 06 ; 08 ; 10 ....

              Ou alors avec un array
              var test = new Array('00','03','06','08','10');

              et après ancien + test[i] ;

              Enfin je sais pas si sa marcherais...
              Je suis en train d'amélioré autre chose ^^ ( pour faire un affichage progressif des images ) avec :
              l'image normal qui augmente et qui enleve le " div.style.display = 'block' " et une fois que l'image et chargé et tout je demande a javascript de lui ajouté un script css pour lui mettre un hover dessus ^^
              • Partager sur Facebook
              • Partager sur Twitter
              Creative Community & Innovation : http://cc-i.ovh
                19 janvier 2009 à 20:20:04

                Et pourquoi tu tient tant a faire 3 6 8 10 ... et avec le background color
                Parce que pour une apparitions en fondu j'ai déjà aidé quelqu'un avec sa :
                i = 0;
                function fondu() {
                       i++;
                       if(i<11) {
                           document.getElementById("contenu_entete_droit").style.opacity = i/10;
                           document.getElementById("contenu_entete_droit").style.filter = i*10;
                           setTimeout(fondu,100);
                       }
                }
                window.onload = fondu();
                


                Et si tu veux le rappeler tu met i=0; puis fondu();
                • Partager sur Facebook
                • Partager sur Twitter

                Script d'apparition de div...

                × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
                × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
                • Editeur
                • Markdown