用JQuery 实现的自定义对话框

2020-05-24 21:28:48易采站长站整理

        if(option.parent) 
        { 
            $(‘#’ + option.parent).append(html); 
        } 
        else 
        { 
            $(document.body).append(html); 
        } 
    } 
    //设置显示时背景式样 
    function SetEnabledStyle() 
    { 
        var de,w,h,css,region; 
        region = GetDocumentRegion(); 
        css ={width:region.width+”px”,height:region.height+”px”, 
        left: MessageBox_scrollleft+’px’,top: MessageBox_scrolltop +’px’} 
        GetOpacity(css); 
        $(“#messagebox_enabled”).css(css); 
        $(“#messagebox_enabledframe”).css(css); 
    } 
    //设置透明式样 
    function GetOpacity(css) 
    { 
        if(window.navigator.userAgent.indexOf(‘MSIE’)>=1) 
        { 
            css.filter= ‘progid:DXImageTransform.Microsoft.Alpha(opacity=30)’; 
        } 
        else 
        { 
            css.opacity= ‘0.3’; 
        }    
    } 
    //设置对话框试样 
    function SetStyle(option) 
    { 
        var region,css; 
        region = GetDocumentRegion(); 
        css ={width:MessageBox_width+’px’,height:MessageBox_height+’px’, 
        left: ((region.width – MessageBox_width)/2)+’px’,top: ((region.height – MessageBox_height)/2)+’px’}