Javascript

Você está em: Home » Desenvolvimento » Javascript » z-index com jQuery Galeria funcional

« Voltar

z-index com jQuery Galeria funcional

27 de outubro de 2009 - 20:42


Script:

$(document).ready(function(){ var z = 0; var inAnimation = false; $("#fotos img").each(function(){ z++; $(this).css("z-index", z); }); function swapFirstLast(isFirst){ if(inAnimation) return false; else inAnimation = true; var processZindex, direction, newZindex, inDeCrease; if(isFirst){ processZindex = z; direction = "-"; newZindex = 1; inDeCrease = 1; } else { processZindex = 1; direction = "-"; newZindex = z; inDeCrease = -1; } $("#fotos img").each(function(){ if($(this).css("z-index") == processZindex){ $(this).animate({"top" : direction + $(this).height() + "px"}, "slow", function(){ $(this).css("z-index", newZindex) .animate({"top" : "0"}, "slow", function(){ inAnimation = false; }); }); } else { $(this).animate({"top" : "0"}, "slow", function(){ $(this).css("z-index", parseInt($(this).css("z-index")) + inDeCrease); }); } }); return false; } $("#proximo a").click(function(){ return swapFirstLast(true); }); $("#anterior a").click(function(){ return swapFirstLast(false); });
});

Script Completo CLIQUE AQUI

Fonte: Ted K

O que você achou deste conteúdo?

  • Bom
  • Ruim
 

  • del.icio.us
  • Digg
  • reddit
  • StumbleUpon
  • Technorati
 

Comentários (1)

cristocam comentou 2 anos atrás
esse codigo fonte tem em artefatos que tipo de programação unica remota que possamos ultilizar online

Comente

 

Trocar imagem

 

Importante: Os comentários publicados através deste website são de exclusiva e integral responsabilidade de seus autores.

publicidade

Fonte

Ted K

Ted K

Assuntos do mundo digital sobretudo e-commerce, tendências e lançamentos.

publicidade

IMD Auditoria