Kor
06-03-2003, 01:58 PM
i wanna, for instance, change the style color, something like this:
function objectSetup() {
zclic = new layerSetup("clic","#FF0000");
}
function layerSetup(id,color){
this.obj = document.getElementById(id).style;
this.obj.color = color;
return this.obj;
}
function culoare(){
var zwclic = zclic.color;
if(zwclic = "#FF0000"){
zclic.color = "#0000FF";
}
else if(zwclic = "#0000FF"){
zclic.color = "#FF0000";
}
}
and in body
<body bgcolor onload="objectSetup()">
<a href="#" id="clic" onclick="culoare(); return false">CLICK</a>
</body>
The color chages first time, and that is all....
function objectSetup() {
zclic = new layerSetup("clic","#FF0000");
}
function layerSetup(id,color){
this.obj = document.getElementById(id).style;
this.obj.color = color;
return this.obj;
}
function culoare(){
var zwclic = zclic.color;
if(zwclic = "#FF0000"){
zclic.color = "#0000FF";
}
else if(zwclic = "#0000FF"){
zclic.color = "#FF0000";
}
}
and in body
<body bgcolor onload="objectSetup()">
<a href="#" id="clic" onclick="culoare(); return false">CLICK</a>
</body>
The color chages first time, and that is all....