<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    http://www.tkk7.com/ebecket 返還網
    隨筆-140  評論-11  文章-131  trackbacks-0
    //Xingmai命名空間
    if(!Xingmai)
    var Xingmai = {};

    //內容窗口
    Xingmai.ContentBox =
    {
    //創建窗口
    CreateBox : function()
    {
    //創建窗體
    var contentBox = {};

    //ID
    contentBox.ID = null;

    //窗口Title
    contentBox.Title = null;

    //窗口寬度
    contentBox.Width = null;

    //窗口高度
    contentBox.Height = null;

    //窗口左像素
    contentBox.Left = null;

    //窗口頂像素
    contentBox.Top = null;

    //Class定義
    contentBox.ClassName= null;

    //默認值
    contentBox.Common = {
    Width : 500,
    Height : 400,
    Left : (document.documentElement.clientWidth - contentBox.Width)/2 + document.documentElement.scrollLeft,//有問題
    Top : (document.documentElement.clientHeight - contentBox.Height)/2 + document.documentElement.scrollTop //有問題
    };
    //創建BOX
    contentBox.Create = function()
    {
    //alert("a");
    //創建主要界面
    var newBox = document.createElement("div");
    newBox.setAttribute("id", contentBox.ID);
    with(newBox.style)
    {
    position = "absolute";
    zIndex = "9999";
    width = contentBox.Width + "px";
    height = contentBox.Height + "px";
    top = contentBox.Top;
    left = contentBox.Left;
    }
    //newBox.setAttribute("style", "width : " + contentBox.Width + "px; height : " + contentBox.Height + "px;");
    if(contentBox.ClassName!=null)
    newBox.setAttribute("className", contentBox.ClassName);

    //創建標題欄和刪除按鈕
    var titleSpan = document.createElement("div");
    with(titleSpan.style)
    {
    height = "20px";
    textAlign = "left";
    verticalAlign = "middle";
    }
    //titleSpan.setAttribute("style", "height : " + "35" + "px;");
    titleSpan.setAttribute("class","contentTitleSpan");
    var spanDiv = document.createElement("div");
    with(spanDiv.style)
    {
    width = contentBox.Width - 30 + "px";
    styleFloat = "left";
    textAlign = "left";
    }
    spanDiv.appendChild(document.createTextNode(contentBox.Title));
    titleSpan.appendChild(spanDiv);

    var closeDiv = document.createElement("div");
    with(closeDiv.style)
    {
    width = "20px";
    styleFloat = "right";
    textAlign = "right";
    }
    var closeButton = document.createElement("a");
    closeButton.setAttribute("href", "#");
    closeButton.appendChild(document.createTextNode("×"));
    $addHandler(closeButton,"click", function(){Xingmai.ContentBox.KillBox(contentBox.ID);});
    closeDiv.appendChild(closeButton)
    titleSpan.appendChild(closeDiv);
    newBox.appendChild(titleSpan);

    //創建Iframe
    var iframe = document.createElement("iframe");
    iframe.setAttribute("class","contentIframe")
    iframe.setAttribute("src" , contentBox.Url);
    iframe.setAttribute("frameborder","0",0);
    iframe.setAttribute("scrolling","no");
    with(iframe.style)
    {
    border = "0";
    width = "100%";
    height = (contentBox.Height - 20) + "px";
    }
    newBox.appendChild(iframe);

    return newBox;
    };

    //創建ID
    contentBox.CreateID = function()
    {
    var now = new Date();
    return "ContentBox" + now.getFullYear() + now.getMonth() + now.getDay() + now.getHours() + now.getMinutes() + now.getSeconds() + now.getMilliseconds();
    };

    //顯示窗口
    contentBox.Show = function()
    {
    //處理默認值
    contentBox.ID = contentBox.ID == null ? contentBox.CreateID() : contentBox.ID;
    contentBox.Title = contentBox.Title == null ? "內容系統窗口" : contentBox.Title;
    contentBox.Url = contentBox.Url == null ? "about:blank" : contentBox.Url;
    if(isNaN(contentBox.Width)||contentBox.Width == null)
    contentBox.Width = contentBox.Common.Width;
    if(isNaN(contentBox.Height)||contentBox.Height == null)
    contentBox.Height = contentBox.Common.Height;
    if(isNaN(contentBox.Left)||contentBox.Left == null)
    contentBox.Left = contentBox.Common.Left;
    if(isNaN(contentBox.Top)||contentBox.Top == null)
    contentBox.Top = contentBox.Common.Top;

    //創建窗口并顯示
    var add = contentBox.Create();
    document.getElementsByTagName("body").item(0).appendChild(add);
    };

    return contentBox;
    },

    //刪除窗口
    KillBox : function(id)
    {
    var box= document.getElementById(id);
    if(box)
    box.parentNode.removeChild(box);
    }
    };
    posted on 2010-02-28 23:50 becket_zheng 閱讀(286) 評論(0)  編輯  收藏 所屬分類: 網頁web前端技術
    主站蜘蛛池模板: 亚洲精品免费网站| 国产精品亚洲αv天堂无码| 在线亚洲v日韩v| 亚洲精品乱码久久久久久自慰| 69pao强力打造免费高清| 国产成人+综合亚洲+天堂| 亚洲国产精品一区| 国产高清在线免费视频| 暖暖日本免费中文字幕| 色欲色欲天天天www亚洲伊| 国产亚洲成人在线播放va| 久久精品免费全国观看国产| 一级毛片成人免费看a| 亚洲中字慕日产2020| 亚洲无线码在线一区观看| 最近免费中文字幕视频高清在线看 | 亚洲无码黄色网址| 一区二区无码免费视频网站| 一级日本高清视频免费观看| 亚洲人成日本在线观看| 亚洲精品午夜无码电影网| 在线观看永久免费视频网站| 久久精品一本到99热免费| 4hu四虎免费影院www| 亚洲午夜无码久久久久小说| 亚洲国产一区在线| 国产亚洲?V无码?V男人的天堂 | 日韩免费视频播播| 13一14周岁毛片免费| 中文永久免费观看网站| 国产亚洲精品免费| 亚洲情A成黄在线观看动漫软件 | 亚洲视频在线一区| 亚洲伊人成无码综合网| 国产精品色午夜视频免费看 | 亚洲美女自拍视频| 亚洲精品无码mv在线观看网站| 亚洲?V乱码久久精品蜜桃 | 亚洲av日韩av无码黑人| 亚洲午夜无码片在线观看影院猛| 好吊妞视频免费视频|