关于网页上的一个图片效果!
正在做一个自己的静态网, 我想要这种效果, 就是鼠标移上去的时候图片会变得更亮, 也就是说之前透明度为80%, 鼠标移上去就是100%显示.
而且还带有链接, 原先以为很简单,但是从网页上考了几个代码都不行, 本人网页方面还是菜鸟. 望高手指教. 谢谢//.
参考答案:我给你代码,图片地址需要你自己修改,有汉语提示,最后把汉字提示删除掉就可以了,有什么不懂的加我QQ ***********,只要我懂一定给你解答,互相学习,加的时候说明目的
<body bgcolor=pink>
<script language=JavaScript>
<!-- Beginning of JavaScript Code -------------------
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "[object]"){ setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimers[object.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjects[object.sourceIndex]=object;
nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}
// -- End of JavaScript Code -->
</script>
//修改下面的图像地址和大小
<TABLE align=center border=0 cellPadding=0 cellSpacing=1>
<TBODY>
<TR align=middle>
<TD background=图片地址
height=60 width=60><A
href="连接地址"><IMG
alt="Dreamweaver 资源" border=0 height=60
onmouseout=nereidFade(this,01,7,5)
onmouseover=nereidFade(this,100,5,7)
src="图片地址"
style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FILTER: alpha(opacity=0)"
width=60></A></TD>
<TD background=图片地址 height=60
width=60><A
href="连接2"><IMG
alt="Fireworks 资源" border=0 height=60
onmouseout=nereidFade(this,01,7,5)
onmouseover=nereidFade(this,100,5,7)
src="图片地址"
style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FILTER: alpha(opacity=0)"
width=60></A></TD>
<TD background=图片地址 height=60
width=60><A
href="连接地址"><IMG
alt="Flash 资源" border=0 height=60 onmouseout=nereidFade(this,01,7,5)
onmouseover=nereidFade(this,100,5,7)
src="图片地址"
style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FILTER: alpha(opacity=0)"
width=60></A></TD>
<TD background=图片地址 height=60
width=60><A
href="连接地址"><IMG
alt="Photoshop 资源" border=0 height=60
onmouseout=nereidFade(this,01,7,5)
onmouseover=nereidFade(this,100,5,7)
src="图片地址"
style="BORDER-BOTTOM: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FILTER: alpha(opacity=0)"
width=60></A></TD>
</TR></TBODY></TABLE>
</body>