<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 閱讀(287) 評論(0)  編輯  收藏 所屬分類: 網頁web前端技術
    主站蜘蛛池模板: 亚洲日本中文字幕天堂网| 亚洲精品电影天堂网| 久久免费视频99| 亚洲色大网站WWW永久网站| 久久亚洲av无码精品浪潮| 亚州免费一级毛片| 青青草97国产精品免费观看 | 97久久精品亚洲中文字幕无码| 无码国产精品一区二区免费式影视| 久久亚洲欧美国产精品| 亚洲Av无码专区国产乱码DVD| 最近免费中文字幕视频高清在线看| 一级毛片a免费播放王色| 国产日韩在线视频免费播放| 亚洲综合在线视频| 四虎永久在线精品免费观看地址| 国产一区二区三区免费| 噜噜综合亚洲AV中文无码| 亚洲伊人tv综合网色| 国产高清在线免费| 黄色成人免费网站| 国产特黄一级一片免费| 亚洲欧美日韩综合久久久久| 亚洲AV人无码激艳猛片| 亚洲第一区精品日韩在线播放| h视频在线观看免费完整版| 一个人看的免费观看日本视频www 一个人看的免费视频www在线高清动漫 | 国产亚洲欧洲Aⅴ综合一区| 免费在线观看的网站| 无码国产精品一区二区免费3p| 暖暖免费中文在线日本| 激情五月亚洲色图| 亚洲精品在线视频观看| 亚洲啪啪AV无码片| 久久精品电影免费动漫| 又大又硬又粗又黄的视频免费看| 亚洲色无码国产精品网站可下载| 亚洲一卡2卡三卡4卡有限公司 | 亚洲一区二区观看播放| 亚洲精品无码久久久久久久| 久久亚洲综合色一区二区三区|