鼠标移动到版块图标产生的渐变效果

1.inc/main.js末尾增加如下代码:

//渐隐渐现函数
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);
}
}

2.index模板html(7):

function showboard

.......

if (indexIMG!='')
{
  str = str.replace(/{/$indexIMG}/gi,'<table align="left"><tr><td><a href="list.asp?boardid='+BoardID+'"> <img src='+indexIMG+' align="top" border="0" style="FILTER: alpha(opacity=40)" onMouseOut=nereidFade(this,40,10,10) onMouseOver=nereidFade(this,100,0,10) ></a></td><td width="20"></td></tr></table>');
}
else
{
  str = str.replace(/{/$indexIMG}/gi,'');
}

......

增加以上红色部分
阅读更多
个人分类: HTML+CSS+JS
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭