javascript 构造函数方式 对象
来源:互联网 发布:linux cpu使用率过高 编辑:程序博客网 时间:2024/04/30 09:40
/**
* 构造函数方式 对象
*/
function TimerUitls() {
this.setParam = setParam;
this.runTimer = runTimer;
this.runCall = runCall;
this.isState = isState;
this.init = init;
var counter = 0;
var max = 0;
var time = 100;
var states = "uninitialized";
var oDom = null;
function setParam(p_max, p_time) {
max = p_max;
counter = p_max+1;
time = p_time;
}
function runTimer() {
counter++;
if (counter <= max) {
setTimeout(runTimer, time);
} else {
var state = isState(); //
if (state == "complete") {
runCall();
} else {
counter = 0;
runTimer();
}
}
}
function isState(){
var o_state ="";
if (typeof(oDom) == "object") {
o_state = oDom.document.readyState;
}
return o_state;
}
function runCall(){
}
function init(p_dom,p_max,p_time) {
oDom = p_dom;
setParam(p_max, p_time);
runTimer();
}
}
* 构造函数方式 对象
*/
function TimerUitls() {
this.setParam = setParam;
this.runTimer = runTimer;
this.runCall = runCall;
this.isState = isState;
this.init = init;
var counter = 0;
var max = 0;
var time = 100;
var states = "uninitialized";
var oDom = null;
function setParam(p_max, p_time) {
max = p_max;
counter = p_max+1;
time = p_time;
}
function runTimer() {
counter++;
if (counter <= max) {
setTimeout(runTimer, time);
} else {
var state = isState(); //
if (state == "complete") {
runCall();
} else {
counter = 0;
runTimer();
}
}
}
function isState(){
var o_state ="";
if (typeof(oDom) == "object") {
o_state = oDom.document.readyState;
}
return o_state;
}
function runCall(){
}
function init(p_dom,p_max,p_time) {
oDom = p_dom;
setParam(p_max, p_time);
runTimer();
}
}
- javascript 构造函数方式 对象
- javascript 构造函数方式定义对象
- javascript,类与对象,构造函数方式
- Javascript构造对象方式
- JavaScript构造函数创建对象
- JavaScript 创建对象 构造函数
- Javascript构造函数、原型、对象
- javascript面向对象 -- 构造函数
- javascript工厂方式、构造函数、原型方式
- javascript工厂方式、构造函数、原型方式
- Javascript两种对象构造器方式
- javascript定义类或对象:混合的构造函数/原型方式
- JavaScript学习12 JS中定义对象的几种方式(原型和构造函数)
- JavaScript对工厂模式、构造函数、原型、字面量方式、继承、对象冒充的理解
- JavaScript——创建对象的五种方式分析(工厂模式 原型 构造函数)
- 面向对象--工厂方式和构造函数
- JavaScript面向对象编程[一] 构造函数
- javascript面向对象编程构造函数继承
- 694 - The Collatz Sequence
- winform安装项目、安装包的制作、部署
- MMC/SD卡驱动实例开发讲解(一)
- 457 - Linear Cellular Automata
- 401 - Palindromes
- javascript 构造函数方式 对象
- FFmpeg完美入门【3】-FFmpeg功能及使用说明
- 判断是否是素数
- MMC/SD卡驱动实例开发讲解(二)
- 10010 - Where's Waldorf?
- centOS 安装g++
- UTF-8编码字符串的Trim() 在.35和4.0中的行为区别
- 跳表(Skip List)的介绍以及查找插入删除等操作
- HDU 1874 畅通工程续