var mylayer={
    show:function(title,url, callBack, isMaxMin, w,h,params,closecallback){
    if (title == null || title == ‘’) {
    title=false;
    }
    if (url == null || url == ‘’) {
    url=”404.html”;
    }
    if (isMaxMin == null) {
    isMaxMin=true;
    }
    if (w == null || w == ‘’) {
    w=($(window).width() - 50);
    }
    if (h == null || h == ‘’) {
    h=($(window).height() - 50);
    }
    layer.open({
    type: 2,
    area: [w+’px’, h +’px’],
    fix: false, //不固定
    maxmin: isMaxMin,
    shade:0.4,
    title: title,
    content: url,
    end:callBack,
    success: function(layero, index){
    var w = layero.find(“iframe”).get(0).contentWindow;//找到窗口设置回调
    if(w) {
    //w.fromWin = fromWin;
    w.params = params;
    w.closecallback= closecallback;
    }
    }
    });
    //
    },
    close:function(){
    var index = parent.layer.getFrameIndex(window.name);
    parent.layer.close(index);
    }
    };
    //调用
    top.mylayer.show(“活动列表”, “admin/weixin/getWeiXinCouponSelect”, null, false, 800, 600,null,crud.selectcouponcallback);
    //返回

    selectOk:function(e){
    var row = $(e.target).parents(“tr”)
    if(row) {
    var data = crud.list.row(row).data();
    //if(window.fromWin) window.fromWin.crud.selectcouponcallback(data);
    if (window.closecallback) window.closecallback(data);
    mylayer.close();
    }
    },