Bonjour,
Je crée en ce moment un drag 'n drop (du style google: accueil personnalisé) et firefox m'indique une erreur avec ce code :
l'erreur est la suivante :
(La ligne 21 est celle en rouge)
quelqu'un pourrait-il m'indiquer mon erreur.
merci d'avance
Modifié par the_penguin (10 Jan 2006 - 18:41)
Je crée en ce moment un drag 'n drop (du style google: accueil personnalisé) et firefox m'indique une erreur avec ce code :
function block(height, width, left, top, id)
{
// variables
this.height = height;
this.width = width;
this.left = left;
this.top = top;
this.element = document.getElementById(id);
//méthodes
this.setCoord = setCoord;
this.display = display;
this.moveTo = moveTo;
}
function setCoord(left, top)
{
this.left = left;
this.top = top;
[#red]this.element.style.left = this.left + "px";[/#]
this.element.style.top = this.top + "px";
}
function display()
{
this.setCoord(this.left, this.top);
}
l'erreur est la suivante :
a écrit :
Erreur : this.element has no properties
Ligne : 21
(La ligne 21 est celle en rouge)
quelqu'un pourrait-il m'indiquer mon erreur.
merci d'avance

Modifié par the_penguin (10 Jan 2006 - 18:41)