利用csss实现图片切换

来源:百度知道 编辑:UC知道 时间:2024/05/22 02:55:31
在图片代码中 用 this.style 的方式修改
触发onmouseover时间 忘记了this.style.后面怎么写了。
比如改背景图片是 this.style.backgroundImage='url(****)';padding='0px';
改图片要怎样改? this.style.(后面要怎样写?)

onmouseover="this.className='xxx1';" onmouseout="this.className='xxx2';"

然后在css里定义两个不同的样式xxx1和xxx2

{background:url();}

js表示行为,css 表示样式 。样式最好在css中就定义好。js直接调用类或id。

网上很多例子的!