sdfds

<html>
    <head>
        <style type="text/css">
            #MessageBoxBackground{
                width:1024px;height:600px;
                background-color:#eeeeee;
                position:absolute;
                left:0px;top:0px;
                filter:alpha(opacity=70);
               
            }
           
            #MessageBox{
                width:400px;
                /* left:300px;
                height:150px;*/
               
                background-color:#ffffff;
                z-index:10000;
                position:absolute;
                padding:0px;
                border-left:2px solid #ffffff;
                border-top:2px solid #ffffff;
                border-bottom:2px solid gray;
                border-right:2px solid gray;
            }
            #MessageBoxTop{
                background-color:#afcefd;
            }
            #MessageBoxTitle{
                font-size:14pt;
                font-family:"华文新魏";
                color:#af2f3f;
            }
            #MessageBox_CloseButton{
                width:20px;
                height:20px;
               
            }
            #MessageBoxBody, #MessageBoxBody td{
                background-color:#efcadf;
                height:100%;
                padding:4px;
               
                font-size:9pt;
               
            }
            #MessageBox_CloseButton a:link,#MessageBox_CloseButton a:visited{
                text-decoration:none;
            }
        </style>
       
        <script lanauage="javascript">
            function $(strid){
                return document.getElementById(strid);
            }
            function MessageBox_createDivs(){
                document.write('<div id="MessageBox">');
                document.write('<div id="MessageBoxTop"><table width="100%"><tr><td> ');
                document.write(' <div id="MessageBoxTitle">提示:</div> ');
                document.write(' </td><td align="right"> ');
                document.write(' <div id="MessageBox_CloseButton"><a href=\"#\" onclick=\"MessageBox_hide();\" align=\"right\">×</a></div>');
                document.write(' </td></tr></table></div>');
                document.write('<div id="MessageBoxBody">示例内容,请调用相关方法!');
                document.write(" </div> ");
                document.write(" </div> ");
                document.write(" <div id=\"MessageBoxBackground\"> ");
                document.write(" </div> ");
            }
            function MessageBox_setSize(){
                // for(i=0;i<100;i++){ document.write("<br/>"); }
                var bg=document.getElementById("MessageBoxBackground");
                var scroll_top=document.body.scrollTop;
                var scroll_left=document.body.scrollLeft;
                var scroll_width=document.body.offsetWidth;
                var scroll_height=document.body.offsetHeight;
                bg.style.width=(scroll_width-0-scroll_left)+"px";
                bg.style.height=(scroll_height-0-scroll_top)+"px";
                $("MessageBoxBackground").style.display='none';
                $("MessageBox").style.display='none';
            }
            function MessageBox_init(){
                MessageBox_createDivs();
                MessageBox_setSize();
            }
            function MessageBox_show(){
                var scroll_top=document.body.scrollTop;
                var scroll_left=document.body.scrollLeft;
                var scroll_width=document.body.offsetWidth;
                var scroll_height=document.body.offsetHeight;
                var messageBox_width=document.getElementById('MessageBox').style.width;
                var messageBox_left=(scroll_width-400)/2;
                //alert(scroll_width+","+messageBox_width+"");
                document.getElementById('MessageBoxBackground').style.display='';
                document.getElementById('MessageBox').style.display='';
                $("MessageBox").style.left=messageBox_left+"px";
            }
            function MessageBox_hide(){
                document.getElementById('MessageBoxBackground').style.display='none';
                document.getElementById('MessageBox').style.display='none';
               
            }
            function MessageBox_setTitle(title){
                $("MessageBoxTitle").innerHTML=title;
            }
            function MessageBox_setBody(body){
                $("MessageBoxBody").innerHTML=body;
            }
            function MessageBox_addChild(strChild){
                var objChild=$(strChild);
                var obj=$("MessageBoxBody");
                obj.innerHTML=objChild.innerHTML;
                //obj.appendChild(objChild);
            }
            function MessageBox_showDialog(title,div_id){
                MessageBox_setTitle(title);
                MessageBox_addChild(div_id);
                MessageBox_show();
            }
            function MessageBox_showDialogText(title,message){
                MessageBox_setTitle(title);
                MessageBox_setBody(message);
                MessageBox_show();
            }
            MessageBox_init();
        </script>
       
    </head>
    <body id="body">       
       
       
        <div id="div2" style="display:none">
            <table><tr><td>用户名:</td><td><input type="text"/></td></tr>
                <tr><td>密码:</td><td><input type="text"/></td></tr>
            </table>
           
        </div>
        <a href="#" onclick="MessageBox_showDialog('注册!','div2')">open</a>
        <a href="#" onclick="MessageBox_showDialogText('注册!','你好,这是文本的例子')">open</a>
       
    </body>
</html>
此条目发表在 未分类 分类目录,贴了 标签。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>