Ver Mensaje Individual
  #8 (permalink)  
Antiguo 28/11/2008, 19:27
Avatar de marcopoloaz06
marcopoloaz06
 
Fecha de Ingreso: julio-2007
Ubicación: México
Mensajes: 457
Antigüedad: 16 años, 9 meses
Puntos: 11
Respuesta: Delay animation jquery

Hola de nuevo chaaa muchos problemas con la funcion pero ahora si ya la probe con tus ejemplos y no me dio ningun error, espero que tambien la pruebes, bueno ahora si ahi vaaa la chida: xd
Código javascript:
Ver original
  1. // función
  2. $.fn.delay = function( value, fnc ){
  3.     var fnc = fnc || function(){};
  4.     return this.each(function(){
  5.         var $this = this;
  6.         return setTimeout(function(){
  7.             $($this).animate( value || {}, Number( $($this).attr("duracion_animacion") ), function(){fnc.call($this);} );
  8.         }, Number( $(this).attr("delay") ) );
  9.     });
  10. };
  11. // pruebaz
  12. $(document).ready(function(){
  13.     $(".helicopter").delay( {marginLeft:"100%"}, function(){
  14.         alert( $(this).attr("class") );
  15.     });
  16.     $(".helicopter3").delay( {marginLeft:"100%"}, function(){
  17.         alert( $(this).attr("class") );
  18.     });
  19. });
html:
Código HTML:
<div style="width:500px;height:20px;background:#999900;margin-left:100px" id="trayecto1">
<div style="width:20px;height:20px;background:#666666;margin-left:-20px;" class="helicopter" delay="1000" duracion_animacion="20000">
</div>
</div>
<div style="width:500px;height:20px;background:#999900;margin-left:100px" id="trayecto2">

<div style="width:20px;height:20px;background:#666666;margin-left:-20px;" class="helicopter" delay="5000" duracion_animacion="5000">
</div>
</div>
<div style="width:500px;height:20px;background:#999900;margin-left:100px" id="trayecto3">
<div style="width:20px;height:20px;background:#666666;margin-left:-20px;" class="helicopter3" delay="4000" duracion_animacion="3000">
</div>
</div> 
http://polopolomp.6te.net/pruebajQ.html
y perdon por tardarme pero esque luego luego que te conteste la otra me sali

:]
__________________
Aerolíneas Alicia :D

Última edición por marcopoloaz06; 28/11/2008 a las 19:40 Razón: pruebaaaa