彈出無邊窗口
來源:易賢網(wǎng) 閱讀:777 次 日期:2014-08-26 16:13:10
溫馨提示:易賢網(wǎng)小編為您整理了“彈出無邊窗口”,方便廣大網(wǎng)友查閱!

彈出無邊窗口,彈出無邊窗口

<html>

<head>

<script language=javascript>

minimizebar="minimize.gif"; //窗口右上角最小化“按鈕”的圖片

minimizebar2="minimize2.gif"; //鼠標懸停時最小化“按鈕”的圖片

closebar="close.gif"; //窗口右上角關閉“按鈕”的圖片

closebar2="close2.gif"; //鼠標懸停時關閉“按鈕”的圖片

icon="icon.gif"; //窗口左上角的小圖標

function noBorderWin(fileName,w,h,titleBg,moveBg,titleColor,titleWord,scr) //定義一個彈出無邊窗口的函數(shù),能數(shù)意義見下面“參數(shù)說明”,實際使用見最后的實例。

/*

------------------參數(shù)說明-------------------

fileName :無邊窗口中顯示的文件。

w     :窗口的寬度。

h     :窗口的高度。

titleBg :窗口“標題欄”的背景色以及窗口邊框顏色。

moveBg :窗口拖動時“標題欄”的背景色以及窗口邊框顏色。

titleColor :窗口“標題欄”文字的顏色。

titleWord :窗口“標題欄”的文字。

scr :是否出現(xiàn)滾動條。取值yes/no或者1/0。

--------------------------------------------

*/

{

var contents="<html>"+

"<head>"+

&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; "<title>"+titleWord+"</title>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<object id=hhctrl type='application/x-oleobject' classid='clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11'><param name='Command' value='minimize'></object>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "</head>"+

"<body topmargin=0 leftmargin=0 scroll=no onselectstart='return false' ondragstart='return false'>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " <table height=100% width=100% cellpadding=0 cellspacing=1 bgcolor="+titleBg+" id=mainTab>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " <tr height=18 style=cursor:default; onmousedown='x=event.x;y=event.y;setCapture();mainTab.bgColor=\""+moveBg+"\";' onmouseup='releaseCapture();mainTab.bgColor=\""+titleBg+"\";' onmousemove='if(event.button==1)self.moveTo(screenLeft+event.x-x,screenTop+event.y-y);'>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " <td width=18 align=center><img height=12 width=12 border=0 src="+icon+"></td>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " <td width="+w+"><span style=font-size:12px;color:"+titleColor+";font-family:宋體;position:relative;top:1px;>"+titleWord+"</span></td>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " <td width=14><img border=0 width=12 height=12 alt=最小化 src="+minimizebar+" onmousedown=hhctrl.Click(); onmouseover=this.src='"+minimizebar2+"' onmouseout=this.src='"+minimizebar+"'></td>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " <td width=13><img border=0 width=12 height=12 alt=關閉 src="+closebar+" onmousedown=self.close(); onmouseover=this.src='"+closebar2+"' onmouseout=this.src='"+closebar+"'></td>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " </tr>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " <tr height=*>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " <td colspan=4>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " <iframe name=nbw_v6_iframe src="+fileName+" scrolling="+scr+" width=100% height=100% frameborder=0></iframe>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " </td>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " </tr>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; " </table>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "</body>"+

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "</html>";

pop=window.open("","_blank","fullscreen=yes");

pop.resizeTo(w,h);

pop.moveTo((screen.width-w)/2,(screen.height-h)/2);

pop.document.writeln(contents);

if(pop.document.body.clientWidth!=w||pop.document.body.clientHeight!=h) //如果無邊窗口不是出現(xiàn)在純粹的IE窗口中

{

temp=window.open("","nbw_v6");

&nbsp;&nbsp;&nbsp;&nbsp;temp.close();

&nbsp;&nbsp;&nbsp;&nbsp;window.showModalDialog("about:<"+"script language=javascript>window.open('','nbw_v6','fullscreen=yes');window.close();"+"</"+"script>","","dialogWidth:0px;dialogHeight:0px");

&nbsp;&nbsp;&nbsp;&nbsp;pop2=window.open("","nbw_v6");

pop2.resizeTo(w,h);

pop2.moveTo((screen.width-w)/2,(screen.height-h)/2);

pop2.document.writeln(contents);

&nbsp;&nbsp;&nbsp;&nbsp;pop.close();

}

}

</script>

</head>

<body>

<!----------------- 實例一(按鈕),修改參數(shù)可改變窗口樣式 ----------------->

<button onclick=noBorderWin('test.html','400','240','#000000','#333333','#CCCCCC','一個無邊窗口的測試例子','yes');>open</button>

<br><br>

<!----------------- 實例二(鏈接),修改參數(shù)可改變窗口樣式 ----------------->

<a href=#none onclick=noBorderWin('test.html','400','240','#000000','#333333','#CCCCCC','一個無邊窗口的測試例子','yes');>open</a>

<br><br>

<!----------------- 實例三(圖片),修改參數(shù)可改變窗口樣式 ----------------->

<img src=none height=30 width=60 alt=open style="cursor:hand" onclick=noBorderWin('test.html','400','240','#000000','#333333','#CCCCCC','一個無邊窗口的測試例子','no');>無滾動條的

</body>

</html>

更多信息請查看IT技術專欄

更多信息請查看腳本欄目
易賢網(wǎng)手機網(wǎng)站地址:彈出無邊窗口

2025國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機號
  • 驗證碼
關于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務許可證:(云)人服證字(2023)第0102001523號
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權所有:易賢網(wǎng)