Foros del Web » Programando para Internet » Javascript »

llamada a función

Estas en el tema de llamada a función en el foro de Javascript en Foros del Web. hola, ¿como se ha de realizar la llamada a esta función, si quiero incluirla en un .js? gracias. @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código HTML: Ver original < ...
  #1 (permalink)  
Antiguo 27/09/2011, 10:50
 
Fecha de Ingreso: julio-2002
Mensajes: 813
Antigüedad: 21 años, 8 meses
Puntos: 2
llamada a función

hola,

¿como se ha de realizar la llamada a esta función, si quiero incluirla en un .js?

gracias.

Código HTML:
Ver original
  1. <div id="capa" style="position:absolute; right: 20px; top: 10px; width: 250px; color: #555555 ;">
  2. Aqui va el texto que quieras mostrar . . .
  3. </div>

Código Javascript:
Ver original
  1. <body>
  2.  
  3. <script language="JavaScript" type="text/javascript">
  4.  
  5.     var capa =
  6.     {
  7.         topMargin : 30 , //posicion inicial
  8.         ceiling : 55 , //pixels del efecto de amortiguacion
  9.         desplazaTime : 1200 , //tiempo en recorrer la distancia anterior
  10.         capaDiv : document.all ? document.all.capa : (document.layers ? document.capa : document.getElementById('capa'))
  11.     }
  12.  
  13.     window.setInterval("capa.coordenadas( )", 35)
  14.  
  15.     capa.coordenadas = function( )
  16.     {
  17.         if(document.all)
  18.         {
  19.             this.actualY = this.capaDiv.style.pixelTop;
  20.             this.scrollTop = document.body.scrollTop;
  21.         }
  22.         else if(document.layers)
  23.         {
  24.             this.actualY = this.capaDiv.top;
  25.             this.scrollTop = window.pageYOffset;
  26.         }
  27.         else if(document.getElementById)
  28.         {
  29.             this.actualY = parseInt(this.capaDiv.style.top);
  30.             this.scrollTop = window.pageYOffset;
  31.         }
  32.  
  33.         var nuevoScrollTop = Math.max( this.scrollTop + this.topMargin, this.ceiling );
  34.  
  35.         if ( this.actualY != nuevoScrollTop )
  36.         {
  37.             if ( nuevoScrollTop != this.targetY )
  38.             {
  39.                 this.targetY = nuevoScrollTop;
  40.                 this.desplazaInit( );
  41.             }
  42.             this.desplaza( );
  43.         }
  44.     }
  45.  
  46.     capa.desplazaInit = function( )
  47.     {
  48.         var ahora = new Date( )
  49.         this.A = this.targetY - this.actualY ;
  50.         this.B = Math.PI / ( 2 * this.desplazaTime );
  51.         this.C = ahora.getTime( );
  52.         this.D = this.actualY;
  53.     }
  54.  
  55.     capa.desplaza = function( )
  56.     {
  57.         var ahora = new Date( );
  58.         var nuevaY = this.A * Math.sin( this.B * ( ahora.getTime( ) - this.C ) ) + this.D;
  59.         nuevaY = Math.round( nuevaY );
  60.  
  61.         if ( ( this.A > 0 && nuevaY > this.actualY ) || ( this.A < 0 && nuevaY < this.actualY ) )
  62.         {
  63.             if (document.all)
  64.             this.capaDiv.style.pixelTop = nuevaY;
  65.             else if(document.layers)
  66.             this.capaDiv.top = nuevaY;
  67.             else if(document.getElementById)
  68.             this.capaDiv.style.top = nuevaY;
  69.         }
  70.     }
  71.  
  72. </script>
  #2 (permalink)  
Antiguo 04/10/2011, 14:38
 
Fecha de Ingreso: julio-2002
Mensajes: 813
Antigüedad: 21 años, 8 meses
Puntos: 2
Respuesta: llamada a función

alguien me puede ayudar?

Etiquetas: js, llamada
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:32.