$(document).ready(function(){
function obj(id){
var self = this;
this.thisBtn = id;
self.init();
};
obj.prototype.init = function(){
var self = this;
self.btnClick();
};
obj.prototype.btnClick = function(){
var self =this;
var btn = document.getElementById(this.thisBtn);
var btnValue = btn.value;
btn.onclick = function(){
var num = 10;
var time = setInterval(function(){
if(num>1){
clear = false;
num--;
btn.value = num +"后获取";
self.type();
}else{
clear = true;
clearInterval(time);
btn.value = "获取";
}
},1000);
}
}
var new_obj = new obj("obj")
});
qq_冲哥_0
相关分类