Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/11/2010, 18:41
Avatar de ClubIce
ClubIce
 
Fecha de Ingreso: diciembre-2008
Mensajes: 216
Antigüedad: 16 años, 2 meses
Puntos: 2
Respuesta: Error en usando AppendChild

voy a completar mas el codigo:

Código Javascript:
Ver original
  1. /* DHTML Objects */
  2. dhtElement = new Class({
  3.   initialize:function(data){
  4.     for (prop in data) {
  5.       this[prop] = data[prop]
  6.       if (typeof(data[prop].element) != 'undefined' || data[prop].element != null) {
  7.         alert(this.element)
  8.         this.element.appendChild(data[prop].element) // Line 82
  9.       }
  10.     }
  11.   },
  12.   element:null,
  13.   x:function(){},
  14.   y:function(){},
  15.   width:function(){},
  16.   height:function(){},
  17.   draw:function(){
  18.     return this.element
  19.   }
  20. })
  21. dhtComponent = new Class({
  22.   element:$C("div")
  23. },dhtElement)
  24.  
  25. /* Layer Types */
  26.  
  27. dhtLayer = new Class({},dhtElement)
  28.  
  29. lyrDIV = new Class({
  30.   element:$C('div')
  31. },dhtLayer)
  32.  
  33.  
  34.  
  35. /* DHTML Default Componentes  */
  36. dhtLoader = new Class({
  37.   initialize:function(image,text,width,height,bgColor,color,progressBar,porcentage) {
  38.     usedHeight = 0
  39.     if (typeof(image) != 'undefined' && image != "") {
  40.       image = typeof(image) == 'string' ? new lyrImage(image) : image
  41.       image.x((image.width() + width) / 2 - image.width())
  42.       usedHeight = image.height()
  43.       this.ldrImage = image
  44.     } else {
  45.       image = null
  46.     }
  47.     if (porcentage) {
  48.       porcentage = new lyrDinamicText("[1]%")
  49.       porcentage.x(width-porcentage.width())
  50.       this.ldrPorcentage = porcentage
  51.      
  52.     } else {
  53.       porcentage = null
  54.     }
  55.     if (progressBar) {
  56.       progressBar = new dhtComponent({
  57.         box:new lyrDIV({
  58.           bar:new lyrDIV()
  59.         })
  60.       })
  61.       xs = porcentage ? porcentage.width() : 0
  62.       with (progressBar.box) {
  63.         width(width-xs)
  64.         height(height)
  65.         y(usedHeight)
  66.         bar.width(width-xs-2)
  67.         bar.height(height-2)
  68.         bar.x(1)
  69.         bar.y(1)
  70.       }
  71.       usedHeight+=height
  72.       this.ldrProgress = progressBar
  73.     }
  74.     if (typeof(text) == 'string' && text != "") {
  75.       text = new lyrStyledText(text,styLoaderText)
  76.       text.x((width + text.width()) / 2 - text.width())
  77.       text.y(usedHeight)
  78.       this.ldrText = text
  79.     }
  80.   }
  81. },dhtComponent)