function doMove(obj,json,fn){
var iCur = 0;
var alpha = 0;
clearInterval(obj.timer);
obj.timer = setInterval(function(){
var bStop = true;
for(var attr in json){
if(attr == 'opacity'){
iCur = parseInt(parseFloat(getStyle(obj,attr))*100);
}else{
iCur = parseInt(getStyle(obj,attr));
}
var iSpeed = (json[attr]-iCur)/15;
iSpeed = iSpeed>0?Math.ceil(iSpeed):Math.floor(iSpeed);
if(iCur != json[attr]){
bStop = false;
}
if(attr == 'opacity'){
alpha = iCur + iSpeed;
obj.style.filter = 'alpha(opacity='+alpha+')';
obj.style[attr] = alpha/100;
}else{
obj.style[attr] = iCur + iSpeed + 'px';
}
}
if(bStop){
clearInterval(obj.timer);
fn&&fn();
}
},20)
}
function getStyle ( obj, attr ) {
return obj.currentStyle?obj.currentStyle[attr] : getComputedStyle( obj )[attr];
}