//這個是js運動框架,后面是調(diào)用這個函數(shù)?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可以執(zhí)行,但是第二個alert就執(zhí)行不了了,求高人幫忙看看 ????????
鏈式動畫第一個為什么連不起來啊
慕粉4084340
2016-10-13 12:31:56