<!doctype html>; padding:0; } #div1 {height:100px; width:100px; background:red; Margin-left:200px; } </style> <script>window.onload=function() {Odiv1= document.getElementById (' Div1 '); Odiv1.onclick=function() {Startmove ( This, {width:200, Height:300 } ,10) } functionStartmove (obj,json,speed) {clearinterval (Obj.timer); varIcur = 0; Obj.timer= SetInterval (function(){ varIBTN =true; for(varattrinchJSON) { varGoal =Json[attr]; if(attr = = ' opacity ') {Icur= Math.Round (CSS (obj, ' opacity ') *100); } Else{icur=parseint (CSS (obj,attr)); } if(Icur! =goal) {ibtn=false; if(attr = = ' opacity ') {obj.style.opacity= (icur + ispeed)/100; Obj.style.filter= ' Alpha (opacity= ' + (Icur + ispeed) + ') '; } Else{obj.style[attr]= icur + speed + ' px '; } } } if(ibtn) {clearinterval (Obj.timer); } },30); } functioncss (obj,attr) {if(Obj.currentstyle)returnObj.currentstyle[attr]; Else returngetComputedStyle (obj,false) [attr]; } } </script> JS motion Multi-Object motion contains JSON but the values are different.