js对象生成与调用

来源:互联网 发布:linux查看磁盘剩余空间 编辑:程序博客网 时间:2024/06/08 17:37
(function(d){    var me;    var popLayerModule = function(option){        me = this;        me.defaults = {            "initFlag": false,        }        me.currentOption = $.extend({},me.defaults, option);        me.init();    }    popLayerModule.prototype.init = function(){        console.log("init")    }    popLayerModule.prototype.popLayer = function () {        alert(1111)    }    var initPopLayerModule = function(){        var instance;        return {            getInstance : function(option){                if(instance == undefined){                    instance = new popLayerModule(option);                }                return instance;            }        }    }    window.initPopLayerModule = initPopLayerModule;})();



js全局弹出层

原创粉丝点击