Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/03/2009, 14:01
Avatar de foreverOdd
foreverOdd
 
Fecha de Ingreso: noviembre-2007
Ubicación: Caracas
Mensajes: 489
Antigüedad: 16 años, 5 meses
Puntos: 14
Respuesta: Agregar imagen dinámicamente

intentalo asi a ver:

Código javascript:
Ver original
  1. document.observe('dom:loaded', function() {
  2.    
  3.     $$('.links').each(function(val,index){
  4.  
  5.         var btn = document.createElement('img');
  6.         btn.src = 'ampliar.png';
  7.  
  8.         //Attach to DOM
  9.         if(this.next()!=undefined)
  10.             this.insert({top:btn})
  11.         else
  12.             this.insert({bottom:btn})
  13.  
  14.         Element.extend(btn)    
  15.  
  16.         //Position icon
  17.         btn.setStyle({'position':'absolute'});             
  18.  
  19.         var pos = btn.previous().down().cumulativeOffset();
  20.         var size = btn.previous().down().getDimensions();  
  21.  
  22.         btn.setStyle({'rigth':'0','bottom':'0'});
  23.        
  24.  
  25.         //Attach action to icon
  26.         btn.observe('click', function() {
  27.             showPhoto(this.previous()
  28.         }) 
  29.     }      
  30. )
  31. });
__________________
My path is lit by my own fire, I only go where I desire