链式动画第一个为什么连不起来啊

//这个是js运动框架,后面是调用这个函数

 function getStyle(obj,curr)
              {
                if(obj.currentStyle)
                {
                  return obj.currentStyle[curr]
                }
                else
                {
                  return getComputedStyle(obj,false)[curr];
                }
              }
             function  sartMove(obj,attr,iTarget,fnEnd)
             {
              clearInterval(obj.timer)
            var aDiv=document.getElementById('div1')
            var aDi=document.getElementById('div2')
              obj.timer=setInterval(function(){
                var curr=0
                if(attr=='opacity')
                {
                   curr=Math.round(parseFloat(getStyle(obj,attr))*100);

                }
                else
                {
                 curr=parseInt(getStyle(obj,attr))
                }
              
                    
                    var speed=(iTarget-curr)/6;
                    speed>0?Math.ceil(speed):Math.floor(speed);
                    if(curr==iTarget)
                    {
                      clearInterval(obj.timer)
                      if(fnEnd)fuEnd();
                     

                    }
                   else
                   {
                    if(attr=='opacity')
                    {
                      obj.style.opacity=(curr+speed)/100;
                      obj.style.fifter='alpha(opacity:'+(curr+speed)+')'
                    }
                    else
                    {
                    obj.style[attr]=curr+speed+'px'
                   }
                 }

              },30)
             }


//这个是真正的代码,第一个width可以执行,但是第二个alert就执行不了了,求高人帮忙看看         

慕粉4084340
浏览 1573回答 2
2回答

stone310

 if(fnEnd)fuEnd();这里 fnEnd()写错了..

慕粉4084340

改了那个错的函数 还是不行啊
打开App,查看更多内容
随时随地看视频慕课网APP