By Ben
Use the CSS Expression to implement the batch control problem of interface objects:
With the CSS style, we know that you can define a Class property of an object to specify the same style to unify the interface. But how to unify the same type of object event? For example: the interface has countless
Solution:
Use the CSS Expression method,
Specific implementation To see. CSS Writings:
/ * Replace Image CSS * / # IMGScript {/ * Here you can use the object ID to wild style, or you can define a CSS function * / star: expness
ONMOUSEOVER = Function () {/ * Replace Image * / if (this.hover! = null) {this.name = this.src; this.src = this.src.replace ('. jpg', '_over.jpg' ); This.haschg = 1;}}, onmouseout = function () {/ * restore the original picture * / if (this.haschg! = Null) {this.src = this.name; this.haschg = null;}
}
)
} / * End Imgscript * /
IMG in the application style:

Please put your mouse on a.jpg to see the effect