1 var mi_picvi = null;2 3 addEventListener('load', function(e) {4 5 var container = document.getElementById('container');6 pi_picvi = new PicVi(container);7 8 }, true);9 10 11 12 13 var PicVi = function(parent) {14 15 this.dom = document.createElement('div');16 this.dom.className = 'PicVi';17 this.dom.setAttribute('status', 'rest'); 18 this.canvas = [];19 20 var v = '';21 for (var i = 0; i<5; i++) {22 var c = document.createElement('div');23 c.innerHTML = v+'Canvas '+i;24 this.canvas.push(c);25 c.className = 'canvas';26 this.dom.appendChild(c);27 28 v += '<br>';29 }30 31 this.canvas[0].setAttribute('position', 'left');32 this.canvas[1].setAttribute('position', 'center');33 this.canvas[2].setAttribute('position', 'right');34 this.canvas[3].setAttribute('position', 'right');35 this.canvas[4].setAttribute('position', 'right');36 37 38 39 40 parent.appendChild(this.dom);41 return;42 };
Enlace
El enlace para compartir es: