Day_21

Perfect motion frame

the getStyle function (obj, name) 
{ 
	IF (obj.currentStyle) 
	{ 
		return obj.currentStyle [name]; 
        // return all style declarations (including internal, external, inline) by laminating css style rule acting on the final element, IE and Opera 
	} 
	the else 
	{ 
		return the getComputedStyle (obj) [name]; 
        // Get the value of the current element css attributes used, Chrome, and Firefox, Safari 
	} 
} 

function the startMove (obj, JSON, fnEnd) 
// three parameters, the first a selection element, the second array JSON (pattern list), the third callback function 
{the clearInterval (obj.timer); 
	
	obj.timer = the setInterval (function () { 
		var =, bStop to true;	 
		
		for (var attr in JSON) 
		{ 
			var CUR = 0; 
			
			IF (attr == 'opacity') 
			// transparency Analyzing separately performed 
			{
				Math.round = CUR (parseFloat (the getStyle (obj, attr)) * 100); 
				//Math.round obtaining fractional values rounded, less compatible IE7 
			} 
			the else 
			{ 
				CUR = the parseInt (the getStyle (obj, attr)); 
			} 
			
			var = Speed (JSON [attr] -cur) /. 6; 
			Speed Speed => 0 Math.ceil (Speed):? Math.floor (Speed); 
			// rounded up 
			
			IF (CUR = JSON [attr]!) 
				, bStop = to false; 
			
			IF (attr == 'Opacity') 
			{ 
				obj.style.filter = 'Alpha (Opacity:' + (+ Speed CUR) + ')'; 
				obj.style.opacity = (CUR + Speed) / 100; 
			} 
			the else 
			{ 
				obj.style [attr] = CUR + + Speed 'PX'; 
			} 
		} 
		
		IF (, bStop) 
		{ 
			the clearInterval (obj.timer); 
			IF (fnEnd) fnEnd (); 
		} 
		
	}, 30); 
}

  Recent ready to build their own server, and may be updated detailed process to build server, busy, after one week may be more an article, essay this kind of thing, free to write about.

  And my blog recently renovated, plate a little ugly TT.

 

Guess you like

Origin www.cnblogs.com/Whonenow/p/11266223.html