I am trying to create a mouseover routine this way:
[code]
ClImg1 = new Image(); ClImg1.src=”/var/www/html/images/redlight.png”;
ClImg2 = new Image(); ClImg2.src=”/var/www/html/images/greenlight.png”;
[…]
this.climg = document.createElement(“img”);
this.climg.src = ClImg1.src;
this.climg.onmouseover = new Function (this.climg.src = ClImg2.src);
when this runs I get a syntax error from firebug, citing the ClImg2.src (not 1.src, tho) — “
How am I suppposed to do this [I]properly?
[code]
this.mousefunc = new Function (“this.climg.src = ClImg2.src”);
this.climg.onmouseover = this.mousefunc;
gives me “this.climg.src not defined”?
A couple of lines of code from someone and I’ll be fine. Also: what’s the syntax for including parameters to this.mousefunc?