Passatempo per il weekend Gestione FTP in C# con il FrameWork 2.0
Sep 19

Dopo la semplice guida ad ajax, questa volta tocca a Fx.Style, una classe del Framework mootools che permette di animare gli oggetti dom tramite css.

Fare effetti con questa tecnica è molto semplice ad esempio per fare un spostamento da destra a sinistra si procede come segue:

 1: var effectchange = new Fx.Style(‘examplex’, ‘left’, {duration:500});
 2: effectchange.start(10, 100);

Che sta a significare, prendi l’elemento con id uguale a examplex e modifica il parametro left da 10 a 100 e la transazione durera 500 ms, questo causerà uno spostamento, clicca qui per visualizzare lo spostamento

Ciao

Come vedete lo spostamento è molto fluido.

Al posto di left è possibile utilizzare anche un altro attributo.

Come opzioni possono essere passate anche altre cose ecco un semplice esempio con le opzioni più utili:

   1:  var effectchange = new Fx.Style(‘examplex’, ‘left’, { 
   2:                      duration:500,
   3:                      onComplete: function(){
   4:                          alert(‘Animazione terminata’);
   5:                      },
   6:                      onStart: function(){
   7:                          alert(‘Animazione iniziata’);
   8:                      } 
   9:                 });
  10:  effectchange.start(0, 100);


(Nessun voto)
Loading ... Loading ...

2 Responses to “Mootools, Guida agli effetti con CSS (Fx.Style)”

  1. dancerjude Says:

    non funziona, almeno a me… sia su FX che su IE l’errore è : “Fx is not defined”

  2. Danyjey Says:

    Si ho notato che non funziona all’interno dell’articolo, prova a testarlo in homepage (senza cliccare sul titolo)

Inserisci il tuo Commento:

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 5 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a