日期:2014-05-16  浏览次数:20391 次

自定义对话框的问题
本人新人  比较白
研究网上的一段关于自定义对话框的js代码

var Dialog = function()
{
    var me = this;
    this.MaskImage = null;
    this.Content = null;
    this.Text = null;
    this.Container = null;
    this.ImagePath = "img/dialog/";
    this.posX = 0;
    this.posY = 0;
    this.IsDown = false;
    this.Width = 300;
    this.Height = 0;
    this.DocVisibleWidth = 0;
    this.DocVisibleHeight = 0;
    this.DocMaxWidth = 0;
    this.DocMaxHeight = 0;
    this.ImgZIndex = 101;
    this.DialogZIndex = 102;
    this.ButtonOK = null;
    this.ButtonCancel = null;
    this.ButtonRetry = null;
    
    this.Icon =
    {
        Close_Normal: this.ImagePath + "close_normal.png",
        Close_Higthlight: this.ImagePath + "close_highlight.png",
        Mask_Image: this.ImagePath + "mask.png",
        Dialog_Icon: this.ImagePath + "icon.png"
    };

    this.Remove = function()
    {
        document.body.removeChild(this.Container);
        document.body.removeChild(this.MaskImage);
    }

    this.OK = function()
    {
        me.Close();
    }

    this.Retry = function()
    {

    }

    this.Close = function()
    {
        this.Hide();
    }

    this.Hide = function()
    {
        this.Container.style.display = "none";