Created
January 21, 2013 19:59
-
-
Save DeividSaenz/4588802 to your computer and use it in GitHub Desktop.
Prueba de desaparecedor de Divs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var array = new Array(4); //los cuatro divs | |
function clicknhide(x) //el parámetro es el índice en el array al que diste click | |
{ | |
if (x>0) | |
{ | |
for (var i=0; i <= array.length; i++) | |
{ | |
$('div:eq(x+i)').animate('opacity',0,2seg,'ease'); //se animará hasta que la opacidad sea cero en 2seg | |
}; | |
} if (x+1==array.length) //diste click en el último | |
{ | |
$('div:eq(x)').animate('opacity',0,2seg,'ease'); //anima la opacidad hacia cero en 2segundos del div que diste click | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment