日期:2014-05-20  浏览次数:20327 次

CSDN首页图片轮换的部分代码在FF下可以正常工作
MzEffect.MoveTo.Extends(MzEffect,   "MzEffect.MoveTo ").initialize=function()
{
    var   me=this,   obj=me.element,   op=me.options;
    op.originalTop     =   obj.style.top;
    op.originalLeft   =   obj.style.left;
    op.originalPosition   =   obj.style.position;
    me.originalY   =   parseFloat(obj.style.top     ||   '0 ');
    me.originalX   =   parseFloat(obj.style.left   ||   '0 ');
    me.offsetX   =   me.x   -   me.originalX;
    me.offsetY   =   me.y   -   me.originalY;
    if(obj.style.position   ==   " ")   obj.style.position   =   "relative ";

    this.render=function(schedule)
    {
        schedule   =   me.schedule   ||   schedule;
        obj.style.left   =   (me.offsetX   *   schedule   +   me.originalX)   + "px ";
        obj.style.top     =   (me.offsetY   *   schedule   +   me.originalY)   + "px ";
    };
    this.setPosition=function(x,   y)
    {
        obj.style.top     =   y   + "px ";
        obj.style.left   =   x   + "px ";
    };
    this.restore=function()
    {
        obj.style.top     =   op.originalTop;
        obj.style.left   =   op.originalLeft;
        obj.style.position   =   op.originalPosition;
    };
};

//op{interval,   duration,   trend,   color,   beginColor,   endColor,   finalColor}
function   n2h(s){s=parseInt(s).toString(16);return   ( "00 "+   s).substr(s.length);}
MzEffect.Highlight=function(element,   op){MzEffect.apply(this,   arguments);};
MzEffect.Highlight.Extends(MzEffect,   "MzEffect.Highlight ").initialize=function()
{
    var   op=this.options,   obj=this.element,   endColor= "#FFFFFF ";
    if(System.ie)   var   backColor   =   (obj.currentStyle||obj.style).backgroundColor;
    else   var   backColor   =   obj.getCssValue( "background-color ");
    op.originalBgColor   =   obj.style.backgroundColor;
    op.originalColor   =   obj.style.color;
    if(backColor)   endColor   =   MzEffect.formatColor(backColor);
    op.beginColor   =   op.beginColor   ||   "#FFFF00 ";
    op.endColor       =   op.endColor   ||   endColor;
    op.finalColor   =   op.finalColor   ||   obj.style.backgroundColor;

    this.colors_base=[
        parseInt(op.beginColor.substring(1,3),16),
        parseInt(op.beginColor.substring(3,5),16),
        parseInt(op.beginColor.substr(5),16)];
    this.colors_var=[
        parseInt(op.endColor.substring(1,3),16)-this.colors_base[0],
        parseInt(op.endColor.substring(3,5),16)-this.colors_base[1],