1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| var Page = Class.create(Composant,{
initialize: function(element_parent,name,largeur,hauteur,couleur_fond,couleur_page) {
this.element_parent = element_parent;
this.name = name;
this.largeur = largeur + "px";
this.hauteur = hauteur + "px";
this.couleur_fond = couleur_fond;
this.couleur_page = couleur_page;
this.position = position;
this.page = document.createElement('div');
this.page.style.width = this.largeur;
this.page.style.height = this.hauteur;
this.element_parent.appendChild(this.page);
this.positionne(this.position);
window.onresize = this.centre();
this.centre();
},
centre: function () {
this.position = position;
this.page.style.position = "absolute";
this.page.style.left = $("body").offsetWidth / 2 - this.page.offsetWidth / 2 + "px";
}
}); |