今天开始学高级的部分,感觉还是蛮…复杂的。对我来说,其实理解会用自然可以了,学习得越多自然就会对复杂的概念有所了解。
先贴一部分今天上课时的代码:
function Style(btnId, divId, bgColor,color) {
this.bgColor = bgColor;
this.color = color;
this.btnId = document.getElementById(btnId);
this.divId = document.getElementById(divId);
this.height;
}
Style.prototype.init = function () {
console.log(this);//指向的实例对象