响应鼠标的图片明暗变化

来源:互联网 发布:软件测试 ppt 编辑:程序博客网 时间:2024/06/09 17:35

下边这段代码放在<head></head>之间:

<script language="javascript1.2">
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=20
}

function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}

</script>

在要实现效果的图片代码中放置下面的代码:

<img style="filter:alpha(opacity=40)" onMouseover="high(this)" onMouseout="low(this)" src="../ppimg/../../images/clip/0229.gif" width="170" height="111">

原创粉丝点击