Modificar a ação de um JavaScript, como fazer?
Olá amigos, Como Faço Para inverter uma ação de Efeito Caindo para Efeito Subindo? veja o código abaixo: (tentei modificar de Falling para Rising e não funcionou)
/ *********************************************** ****************
*
* File: JSFX_Falling.js © JavaScript-FX.com
*
* Los CRIADO: 2000/05/16
*
* Autor: Roy Whittle www.Roy.Whittle.com
*
* Objetivo: CRIAR Animação imagens "Qaeda" na Janela Do Navegador
*
* História
* Dados Versão DESCRIÇÃO
*
* 2001-03-17 2.0 convertido Paragrafo javascript-fx
* 2001-12-01 2.1 Remover a necessidade de JSFX.Sprite (Use FallingSprite Vez)
* 2001-12-01 2.2 renomeado de "Snow" e "Falling". Por Que?
* Como OS Usuários de: Não percebi Que Voce PODE EUA-lo Paragrafo Como Folhas
* Ou confete OU QUALQUÉR Outro Objeto los Queda !!!!!!
************************************************ ******************* /
/ *
* Classe FallingSprite estende Camada
* /
JSFX.FallingSprite = function (theHtml)
{
// Chama o Construtor da superclasse
this.superC = JSFX.Layer;
this.superC (theHtml);
this.x = Math.random () * (JSFX.Browser.getMaxX () - 65);
this.y = -40;
this.dx = Math.random () * 4-2;
this.dy = Math.random () * 6 + 2;
this.ang = 0;
this.angStep = 0,2;
this.amp = 10;
this.state = "Queda";
this.moveTo (this.x, this.y);
this.show ();
}
JSFX.FallingSprite.prototype = new JSFX.Layer;
JSFX.FallingSprite.prototype.animate = function (){
if (this.state == "OFF")
voltar;
this.x + = this.dx;
this.y + = this.dy;
this.ang + = this.angStep;
this.moveTo (this.x + this.amp * Math.sin (this.ang), this.y);
if ((this.x> JSFX.Browser.getMaxX () - 65)
|| (This.x <JSFX.Browser.getMinX () - 0)
|| (This.y> JSFX.Browser.getMaxY () - 65))
{
if (this.state == "Parar")
{
this.moveTo (-100, -100);
this.hide ();
this.state = "OFF";
}
Mais
{
this.x = Math.random () * (JSFX.Browser.getMaxX () - 65);
this.y = JSFX.Browser.getMinY () - 40;
this.dx = Math.random () * 4-2;
this.dy = Math.random () * 6 + 2;
this.ang = 0;
}
}
}/ Classe FallingObj estende Objeto /
JSFX.FallingObj = function (numSprites, theimage, StopTime)
{
this.id = "JSFX_FallingObj _" + ++ JSFX.FallingObj.count;
this.sprites = new Array ();
for (i = 0; i <numSprites; i ++)
{
this.sprites [i] = new JSFX.FallingSprite (theimage);
}
Janela [this.id] = this;
this.animate ();
if (stopTime)
setTimeout ("Janela" + + this.id, stopTime * 1000 "stop ()"). .;
}
JSFX.FallingObj.count = 0;
JSFX.FallingObj.prototype.stop = function (){
for (i = 0; i <this.sprites.length; i ++)
this.sprites [i] .state = "Parar";
}
JSFX.FallingObj.prototype.animate = function (){
setTimeout ("Janela" + + this.id, 40 "Animar ().") .;
for (i = 0; i <this.sprites.length; i ++)
this.sprites [i] .animate ();
}/ FIM Classe FallingObj /
/ *
* Classe de Queda de Objetos (estende um Método estático Pará de Criação de "Qaeda" Objetos
* /
JSFX.Falling = function (n, theimage, stopTime)
{
myFalling = new JSFX.FallingObj (n, "<a href='[http://tonygifsjavas.com.br/'](http://tonygifsjavas.com.br/) target='_blank'> <img style =" border: none; "src =" http: // www .tonygifsjavas.com.br / efeitos_para_blogs / efeito_arvore_natal_caindo / arvore_ "+ theimage +" gif "/> </a>", stopTime);
voltar myFalling;
}Discussão (5)
Carregando comentários...