鼠标经过图片变色

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<script language="javascript">
<!--
function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=70
else
cur.filters.alpha.opacity=100
}
/-->
</script>
<img src="1.jpg" style="filter:alpha(opacity=100)" onmouseover="makevisible(this,0)" onmou
seout="makevisible(this,1)">
</body>
</html>

第二种,

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if ((navigator.appName.indexOf('Microsoft')+1)) {
document.write('<style type="text/css"> .opacity1 {filter:alpha(opacity=50)} .opacity2 {filter:alpha(opacity=100)} </style
>'); }
if ((navigator.appName.indexOf('Netscape')+1)) {
document.write('<style type="text/css"> .opacity1 {-moz-opacity:0.5} .opacity2 {-moz-opacity:1} </style>'); }
else {
document.write(''); }
// End -->
</script>

<img src="/sblog/images/main_7.gif" width="109" height="73" border="0" class="opacity2" onmouseover="this.className='opacity
1'" onmouseout="this.className='opacity2'">

原文地址:https://www.cnblogs.com/xiaoky/p/3804048.html