如标题,请高手指教
希望是一个通用的效果,因为先前在网上找了好多,都不支持火狐的
谢谢了....<script>
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);
    }
}
</script><body><input type="image" src="search.jpg" onmouseout="nereidFade(this,50,10,5)" onmouseover="nereidFade(this,100,10,5)"
                    style="cursor: pointer;filter: alpha(opacity=55); width:94px; height:27px"></body>这是现在的代码,火狐不兼容

解决方案 »

  1.   

    filter类似的滤镜火狐是不支持的 。
      

  2.   

    用jquery
    input type="image" 这个对象加个id如 imgEx
    $("#imgEx").hover(function(){$(this).animate({opacity:"0"});},function(){$(this).animate({opacity:"50"});})
      

  3.   

    1.IE6设置透明度
    object.style.filter="alpha(opacity=50)";  
    2.firefox3.5以后设置透明度
    object.style.opacity="0.5";  
    3.firefox3.5以前版本设置透明度
    object.style.mozOpacity="0.5";  PS:自己要做兼容性处理
    或者你可以直接借助于jquery

      

  4.   

    是设置filter时,火狐与IE的不一样,火狐直接设置opacity:.5大家都答到点子上了,谢谢了.....