var aaa=function(tagetDom,option){//各种骚代码this.init();//此处就是初始化}aaa.prototype={init:funtion(){this.event();},event: function () { var _this = this; this.targetDom.addEventListener("click", function () { document.body.appendChild(_this.boxDom); _this.boxDom.style.display = "block"; // 打开遮罩层的回调 _this.options.open && _this.options.open(); }, false); this.boxDom.addEventListener("click", function () { this.style.display = "none"; // 关闭遮罩层的回调 _this.options.close && _this.options.close(); }, false); }}var bbb=new aaa(".abc",{//一波骚赋值})
添加回答
举报
0/150
提交
取消