首页 > Windows开发 > 详细

easyui的window插件再次封装

时间:2014-11-11 15:40:03      阅读:382      评论:0      收藏:0      [点我收藏+]

easyui的window插件再次封装

代码:

bubuko.com,布布扣
/**
* easyui的window插件再次封装
* 2014年11月10日
*/

SimpoWin = {
    showWin: function showWindow(title, url, width, height) {
        if (!top.SimpoWinId) top.SimpoWinId = 0;
        var divId = "simpoWin" + top.SimpoWinId;
        top.$("body").append(‘<div id="‘ + divId + ‘"></div>‘);

        top.$(‘#‘ + divId).window({
            modal: true,
            title: title,
            width: width,
            height: height,
            collapsible: false,
            minimizable: false,
            maximizable: false,
            content: function () {
                return ‘<iframe frameborder="0" src="‘ + url + ‘" style="width: ‘ + (width - 14).toString() + ‘px; height: ‘ + (height - 39).toString() + ‘px; margin: 0;">‘;
            },
            onClose: function () {
                top.SimpoWinId--;
                top.SimpoParentWin.pop();
            }
        }).window(‘open‘);

        top.SimpoWinId++;
        if (!top.SimpoParentWin) top.SimpoParentWin = new Array();
        top.SimpoParentWin.push(window);
    },

    closeWin: function () {
        var divId = "simpoWin" + (top.SimpoWinId - 1).toString();
        top.$(‘#‘ + divId).window(‘close‘);
    },

    GetWinParent: function () {
        return top.SimpoParentWin[top.SimpoParentWin.length - 1];
    }
}
View Code

 

easyui的window插件再次封装

原文:http://www.cnblogs.com/s0611163/p/4089346.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!