Ver Mensaje Individual
  #10 (permalink)  
Antiguo 01/11/2011, 15:51
Avatar de Trublux
Trublux
 
Fecha de Ingreso: octubre-2010
Ubicación: Madrid
Mensajes: 355
Antigüedad: 13 años, 5 meses
Puntos: 48
Respuesta: como hacer slide a la derecha o izquierda

Entonces sería algo así:
Código CSS:
Ver original
  1. #text{display:none; margin-left:-100px}

Código Javascript:
Ver original
  1. var mostrar = function(){
  2.     $("#text").animate({marginLeft:0,opacity:"show"},1000,"linear");
  3. }
  4. var ocultar = function(){
  5.     $("#text").animate({marginLeft:"-100px",opacity:"hide"},1000,"linear");
  6. }
  7.  
  8. $(function(){
  9.     $( '#text2' ).toggle(
  10.         function(){
  11.             mostrar();
  12.         }, function(){
  13.             ocultar();
  14.         }
  15.     );
  16. });

O podrías poner esto:
Código CSS:
Ver original
  1. #text{width:0px; overflow:hidden}

Código Javascript:
Ver original
  1. var mostrar = function(){
  2.     $("#text").animate({width:"100%"},1000,"linear");
  3. }
  4. var ocultar = function(){
  5.     $("#text").animate({width:"0"},1000,"linear");
  6. }
  7.  
  8. $(function(){
  9.     $( '#text2' ).toggle(
  10.         function(){
  11.             mostrar();
  12.         }, function(){
  13.             ocultar();
  14.         }
  15.     );
  16. });

Le he puesto que tarde menos tiempo (antes estaba en 2 segundos, ahora está en 1 segundo)
__________________
eZ Publish Developer Basic Legacy
eZ Publish Developer Basics (4.4)
Alojamientos rurales en España