鼠标图片悬停后的特殊效果[渐变]
[copy]http://www.phpwind.net/read.php?tid-31486-fpage-2.html[/copy]演示地址:http://bbs.1sa.cn/ 将你的鼠标悬停在某个带有HERF的图片上就可以看到效果了!
在header.htm里的</head>[color=Red]前面[/color]加上下面代码
[code]<script language="JavaScript">
<!--
var globopObject;
var opIndex=0;
var cleared=true;
var direction=10;
function dynOpacity(opObject,stop)
{
if (stop)
{
clearInterval(window.tm);
cleared=true;
opIndex=10;
return;
}
globopObject=opObject;
if (opIndex>110) direction=-4;
if (opIndex<0) direction=4;
opIndex+=direction;
globopObject.style.filter='alpha(opacity:' + opIndex + ')';
if (cleared)
{
window.tm=setInterval("dynOpacity(globopObject,false);",1);
cleared=false;
}
//alert(window.tm);
}
function handleevent()
{
if (event.type=="mouseover")
if(event.srcElement.tagName=="IMG")
if (event.srcElement.parentElement.tagName=="A")
{
dynOpacity(event.srcElement,false);
}
if (event.type=="mouseout")
if(event.srcElement.tagName=="IMG")
{
event.srcElement.style.filter="";
dynOpacity(event.srcElement,true);
}
}
document.onmouseover=handleevent;
document.onmouseout=handleevent;
// -->
</script>
[/code] :L[b]站长,这代码有问题,不跟那示范的论坛一样,主要是移到联盟论坛的LOGO上的时候,那些LOGO会全部停止不动了,而且渐变的频率N慢……就跟卡住一样![/b] 哎呀,
我的也有问题啊 这是绝对的好东西!!!!谢谢老大
页:
[1]