关闭

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

589人阅读 评论(0) 收藏 举报
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,'');
}

......

增加以上红色部分
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:400946次
    • 积分:5742
    • 等级:
    • 排名:第4656名
    • 原创:143篇
    • 转载:195篇
    • 译文:0篇
    • 评论:47条