⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 animation.js

📁 Vista日历的Calendar控件Vista日历的Calendar控件.rar
💻 JS
字号:
function Animation(target,targetProperty,closure,precision)
{
	closure=closure||function(x){return x;};
	precision=precision||10;
	this.handle;

	var beginTime=new Date();
	var stopTime=new Date();
	this.Begin=function(){
		beginTime=new Date();
		this.handle=setInterval(
			function(){
				var now=new Date();
				target[targetProperty]=closure(now.getTime()-beginTime.getTime());
			},
			precision
		);
        }

	this.Continue=function(){
		var now=new Date();
		beginTime.setTime(now.getTime()-stopTime.getTime()+beginTime.getTime());

		this.handle=setInterval(
			function(){
				var now=new Date();
				target[targetProperty]=closure(now.getTime()-beginTime.getTime());
			},
			precision
		);
	}

	this.Stop=function(duration){
		
		clearInterval(this.handle);

		if(duration===undefined)
		{
			stopTime=new Date();
			duration=stopTime.getTime()-beginTime.getTime();
		}
		else stopTime.setTime(beginTime.getTime()+duration)
		target[targetProperty]=closure(duration);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -