#imgScript { /*这里使用对象ID来通配样式, 也可以定义一个css函数*/
star:expression( onmouseover = function()
{
/*替换图片*/
if(this.hover != null){
{域名已经过期} = this.src;
this.src = this.src.replace('.jpg', '_over.jpg');
this.HasChg = 1;
}
},
onmouseout = function()
{
/*还原本来的图片*/
if(this.HasChg != null){
this.src = {域名已经过期};
this.HasChg = null;
} } )
}/*end imgScript*/ 应用样式的img: <img src="a.jpg"> 请将鼠标放在a.jpg上看看效果