Skip to content

Instantly share code, notes, and snippets.

@Sandrucola
Created January 22, 2013 21:51
Show Gist options
  • Save Sandrucola/4598804 to your computer and use it in GitHub Desktop.
Save Sandrucola/4598804 to your computer and use it in GitHub Desktop.
Al hacer click en elemento, tienen que desaparecer todos los que están a continuación.
//Opción 1: hide, desaparecen al instante al hacer click.
$("div").bind("click",function(){
$(this).nextAll ('div').hide();})
//Opción 2: animate, desaparecen en un tiempo establecido al hacer click, bajando la opacidad hasta 0.
$("div").bind("click",function(){
$(this).nextAll ('div').animate({
opacity:0
},500,null)
})
//Opción 3:fadeOut, desaparecen en un tiempo preestablecido al hacer click, bajando la opacidad hasta 0, auqnue el tiempo también se puede controlar poniendolo entre los paréntesis.
$("div").bind("click",function(){
$(this).nextAll ('div').fadeOut();})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment