您的位置:首页 > Web前端 > JavaScript

[js小技巧]鼠标移到图片高亮度显示

2006-12-11 16:22 288 查看
关键代码:


<style type="text/css" >


.ComponentImage




{

}{


cursor:hand;


filter:progid:DXImageTransform.Microsoft.Alpha( Opacity=0, FinishOpacity=75, Style=2, Enabled='false');


}


</style>


<script>





//鼠标移上来。高亮度显示


function Highlight(obj)






{


if (obj.filters.length > 0)






{


obj.filters(0).enabled = 'true';


}


}








function UnHighlight(obj)






{


if (obj.filters.length > 0)






{


obj.filters(0).enabled = 'false';


}


}


</script>




所有代码


<html>


<head>


<title>


test page.


</title>




<style type="text/css" >



.ComponentImage




{

}{


cursor:hand;


filter:progid:DXImageTransform.Microsoft.Alpha( Opacity=0, FinishOpacity=75, Style=2, Enabled='false');


}


</style>




<script>






//鼠标移上来。高亮度显示


function Highlight(obj)






{


if (obj.filters.length > 0)






{


obj.filters(0).enabled = 'true';


}


}








function UnHighlight(obj)






{


if (obj.filters.length > 0)






{


obj.filters(0).enabled = 'false';


}


}


</script>


</head>




<body>





<img src="http://www.blogjava.net/images/logo.gif" class="ComponentImage" onmouseover="Highlight(this);" onmouseout="UnHighlight(this);" >


<br>


<font color=red>鼠标移上来看看效果</font>


</html>





注:不支持fireFox


http://www.cnblogs.com/wujun/archive/2006/11/01/546863.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: