首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

modalbox运用

2012-11-23 
modalbox使用需要引入的文件script languagejavascript typetext/javascript src/omsys2/html/re

modalbox使用
需要引入的文件
  <script language="javascript" type="text/javascript" src="/omsys2/html/review/js/bgiframe.js"></script>
    <script language="javascript" type="text/javascript" src="/omsys2/html/review/js/modalbox.js"></script>
    <link href="/omsys2/html/style/default/css/modalbox.css" rel="stylesheet" type="text/css" />


function showModal(tempObj) {
   
        $.modalbox.show({
    boxid:'box',
            modal: true,
            //contentType: 'html', // html selector url
            // content: "<h1>这是内容</h1>", // 依据 contentType 而定
            //contentType: 'selector', // html selector url
            //content: "#dialog", // 依据 contentType 而定
            width: 800,
            height: 570,
            contentType: 'url',
            content: "reviewlist_search.html",
            showCancel: false,
            showOk: false,
            title:'Please set search condition.',
            showTitle: true,
            onok:closebox,
            okBtnName: 'OK',
            cancelBtnName: 'Cancel',
//          zIndex: 900,
            onclose: null, // function 关闭后执行
            onopen: null, // function, 只有返回true时才会显示窗口
            //onok: null, // function 点击确定按钮后,窗口关闭前执行
            oncancel: null // function 点击取消按钮后,窗口关闭前执行
        });

    }
function closebox(){
$.modalbox.close("box");
}
上面是父页面中弹出的modalbox的方法和关闭方法;
子页面中获取父页面中参数(只是做说明,具体还得看你传什么参数):
versionList = window.parent.versionList;
    // alert(versionList);
    // functionList = window.dialogArguments.functionList;
   functionList = window.parent.functionList;
   reviewConditionVO = window.parent.reviewConditionVO;
   creator = window.parent.creator;



window.parent.result = getCondition();
//alert(window.parent.result);
//window.parent.close();
//dook;
window.parent.doOK();


父页面中dook方法:
function doOK()
{
设置你所需要的result值,完全根据需要来,result是从孩子页面中获得的参数
closebox();
}

热点排行