熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

超酷無邊框窗口代碼

2022-06-13   來源: JSP教程 
CW_width為窗口寬度CW_height為窗口高度CW_url為頁面地址
________________________________________________________________________________________________

代碼如下

<script language=JScript>
var CW_width        = ;
var CW_height        = ;
var CW_top        = ;
var CW_left        = ;
var CW_url        = ;
var New_CW        = windowcreatePopup();
var CW_Body        = New_CWdocumentbody;
var content        = ;
var CSS教程 >CSStext        = margin:px;color:black; border:px outset;borderstyle:expression(onmouseout=onmouseup=function(){thisstyleborderStyle=outset} onmousedown=function(){if(eventbutton!=)thisstyleborderStyle=inset});backgroundcolor:buttonface;width:px;height:px;fontsize:px;lineheight:px;cursor:Default;;

includestartDownload(CW_url function(source){content=source});

function insert_content(){
        var temp = ;
        CW_Bodystyleoverflow                = hidden;
        CW_BodystylebackgroundColor        = ;
        CW_Bodystyleborder                =  solid black px;
        content = contentreplace(/<a ([^>]*)>/g<a onclick=parentopen(thishref);return false $>);
        temp += <table width=% height=% cellpadding= cellspacing= border=>;
        temp += <tr style=;fontsize:px;background:#CC;height:;cursor:default ondblclick=\MaxinnerText=MaxinnerText==?:;parentif_max=!parentif_max;parentshow_CW();\ onmouseup=parentdrag_up(event) onmousemove=parentdrag_move(event) onmousedown=parentdrag_down(event) onselectstart=return false oncontextmenu=return false>;
        temp += <td style=color:#ffffff;paddingleft:px>『落伍者』無邊框窗口演示(申請落伍fh)</td>;
        temp += <td style=color:#ffffff;paddingright:px; align=right>;
        temp += <span id=Help  onclick=\alert(此處為幫助信息)\ style=\+CSS教程 >CSStext+fontfamily:System;paddingright:px;\>?</span>;
        temp += <span id=Min   onclick=parentNew_CWhide();parentblur() style=\+CSStext+fontfamily:Webdings;\ title=最小化></span>;
        temp += <span id=Max   onclick=\thisinnerText=thisinnerText==?:;parentif_max=!parentif_max;parentshow_CW();\ style=\+CSStext+fontfamily:Webdings;\ title=還原></span>;
        temp += <span id=Close onclick=parentopener=null;parentclose() style=\+CSStext+fontfamily:System;paddingright:px;\ title=關閉>x</span>;
        temp += </td></tr><tr><td colspan=>;
        temp += <div id=include style=overflow:scroll;overflowx:hidden;overflowy:auto; HEIGHT: %; width:+CW_width+>;
        temp += content;
        temp += </div>;
        temp += </td></tr></table>;
        CW_BodyinnerJavaScript教程 >HTML = temp;
}

setTimeout(insert_content());

var if_max = true;
function show_CW(){
        windowmoveTo( );
        if(if_max){
                New_CWshow(CW_top CW_left CW_width CW_height);
                if(typeof(New_CWdocumentallinclude)!=undefined){
                        New_CWdocumentallincludestylewidth = CW_width;
                        New_CWdocumentallMaxinnerText = ;
                }
               
        }else{
                New_CWshow( screenwidth screenheight);
                New_CWdocumentallincludestylewidth = screenwidth;
        }
}

windowonfocus  = show_CW;
windowonresize = show_CW;

// Move Window
var drag_xdrag_ydraging=false

function drag_move(e){
        if (draging){
                New_CWshow(escreenXdrag_x escreenYdrag_y CW_width CW_height);
                return false;
        }
}

function drag_down(e){
        if(ebutton==)return;
        if(New_CWdocumentbodyoffsetWidth==screenwidth && New_CWdocumentbodyoffsetHeight==screenheight)return;
        drag_x=eclientX;
        drag_y=eclientY;
        draging=true;
        esrcElementsetCapture();
}

function drag_up(e){
        draging=false;
        esrcElementreleaseCapture();
        if(New_CWdocumentbodyoffsetWidth==screenwidth && New_CWdocumentbodyoffsetHeight==screenheight) return;
        CW_top  = escreenXdrag_x;
        CW_left = escreenYdrag_y;
}

</script>

From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19505.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.