Tip: Click lines to highlight, hold ctrl/cmd to multi-select

http://codedumper.com/eleka (30-Jan @ 01:55)

Syntax Highlighted Code

  1. var monEffet = new Fx.Styles('chainTest');
  2.  
  3. var legend = $('monitor');
  4. legend.setText("[ Début ]");
  5.  
  6. monEffet.start({ width:'200px' }).chain(
  7.   function() {
  8.     // Etape 1
  9.     legend.setText("-] Etape 1 ...");
  10.     monEffet.start({ 'background-color':'#BF2', color:'#000'});
  11.   }
  12. ).chain (
  13.   function(){
  14.     ;// Etape 2
  15.     legend.setText("-]] Etape 2 ...");
  16.     monEffet.start.delay( 1000, monEffet,{ opacity:0 });
  17.   }
  18. ).chain (
  19.   function(){
  20.     // Etape 3
  21.     legend.setText("-]]] Etape 3 ...");
  22.     monEffet.start.delay( 3000, monEffet,{ 'background-color':'#0C3', color:'#fff', opacity:1 });
  23.   }
  24. ).chain (
  25.   function(){
  26.     // Fin
  27.     legend.setText("[ Fin ]");
  28.     if (confirm("T'as compris le chainage ?")) $('chainTest').setText("Eh ben t'es fort !");
  29.     else $('chainTest').setText("Concentre toi et relance l'animation !");
  30.     legend.setText("Lancez la chaine d'exécution en cliquant ici");
  31.   }
  32. );

Plain Code

var monEffet = new Fx.Styles('chainTest');

var legend = $('monitor');
legend.setText("[ Début ]");

monEffet.start({ width:'200px' }).chain(
  function() {
    // Etape 1
    legend.setText("-] Etape 1 ...");
    monEffet.start({ 'background-color':'#BF2', color:'#000'});
  }
).chain (
  function(){
    ;// Etape 2
    legend.setText("-]] Etape 2 ...");
    monEffet.start.delay( 1000, monEffet,{ opacity:0 });
  }
).chain (
  function(){
    // Etape 3
    legend.setText("-]]] Etape 3 ...");
    monEffet.start.delay( 3000, monEffet,{ 'background-color':'#0C3', color:'#fff', opacity:1 });
  }
).chain (
  function(){
    // Fin
    legend.setText("[ Fin ]");
    if (confirm("T'as compris le chainage ?")) $('chainTest').setText("Eh ben t'es fort !");
    else $('chainTest').setText("Concentre toi et relance l'animation !");
    legend.setText("Lancez la chaine d'exécution en cliquant ici");
  }
); 

Permalink: http://codedumper.com/eleka