javascript 通用对话框类

Code

 

说明:如果对话框内容为单独网页,需要与LeesAjaxRequest.js结合使用

使用示例:

//ie browser
        if (vBrowser.isIE) {
            document.onreadystatechange = function() {
                if (document.readyState=="complete") {
                    doInit();
                }
            }
        //firefox browser
        }else {
            document.addEventListener("DOMContentLoaded", doInit, false);
        }
       
        function doInit()
        {

            //从网页中动态加载对话框内容
            dlg=new LeesDialogWindow(330,310,"title","id","","/xxxx/xxxx/subjectmanage.htm?ver4","");
            dlg.ShowWindow();//先显示,再关闭;显示的目的是使动态创建的网页元素可用
            dlg.CloseWindow();//关闭的目的,是因为当前用不着它
            getSubjectList();
           
           
            var str_loading="<div unselectable=\"on\" style=\"_moz-user-select:none;margin:20px auto;font-size:15px;font-weight:bold;text-align:center;width:150px;height:30px;\">正在传输数据……</div>"
                            +"<div  unselectable=\"on\" style=\"_moz-user-select:none;margin:10px auto;text-align:center;width:40px;height:40px;\"><img src=\"/images/loading01.gif\" alt=\"正在加载\" /></div>";

            //对话框内容为指定HTML字符串

            //"请等待","正在加载..." 这样一个对话框
            dlg_loading=new LeesDialogWindow(220,150,"请等待","loading","","",str_loading);
            dlg_loading.ShowWindow();
            dlg_loading.CloseWindow();
            dlg_loading.closeButton.style.display="none";
            dlg_loading.contentWindow.style.MozUserSelect="none";//FF下不允许选中内容
            dlg_loading.contentWindow.unselectable="on";//IE下不允许选中内容
        }

posted @ 2009-04-30 23:41  吾非无心  阅读(753)  评论(1编辑  收藏  举报