运行代码 缩小
汉王
HTML代码
复制 格式化 注释 注释 清空
放大
AخA
 
1
<title>IE无法屏蔽的无边框窗口</title>
2
<script language=javascript>
3
minimizebar="images/"; //最小化“按钮”的图片
4
closebar="images/"; //关闭“按钮”的图片
5
icon="images/"; //左上角图标
6
function noBorderWin(fileName,w,h,titleBg,titleColor,titleWord,borderColor,scr)
7
{
8
  nbw=window.open('','','fullscreen=yes');
9
  nbw.resizeTo(w,h);
10
  nbw.moveTo((screen.width-w)/2,(screen.height-h)/2);
11
  nbw.document.writeln("<title>"+titleWord+"</title>");
12
  nbw.document.writeln("<"+"script language=javascript"+">"+"cv=0"+"<"+"/script"+">");
13
  nbw.document.writeln("<body topmargin=0 leftmargin=0 scroll=no>");
14
  nbw.document.writeln("<table cellpadding=0 cellspacing=0 width=300 height=100% style=\"border: 1px solid "+borderColor+"\">");
15
  nbw.document.writeln("  <tr bgcolor="+titleBg+" height=20 onselectstart='return false' onmousedown='cv=1;x=event.x;y=event.y;setCapture();' onmouseup='cv=0;releaseCapture();' onmousemove='if(cv)window.moveTo(screenLeft+event.x-x,screenTop+event.y-y);'>");
16
  nbw.document.writeln("    <td width=21 align=left><img width=12 width=12 src="+icon+"></td>");
17
  nbw.document.writeln("    <td style=\"font-size:12px; color:"+titleColor+";\"><span style='top:1;position:relative;cursor:default;'>"+titleWord+"</span></td>");
18
  nbw.document.writeln("    <td align=right width=30 style=font-size:16px>");
19
  nbw.document.writeln("      <img border=0 width=12 height=12 alt=最小化 src="+minimizebar+" onclick=window.blur();>");
20
  nbw.document.writeln("      <img border=0 width=12 height=12 alt=关闭 src="+closebar+" onclick=window.close();>");
21
  nbw.document.writeln("    </td>");
22
  nbw.document.writeln("  </tr>");
23
  nbw.document.writeln("  <tr>");
24
  nbw.document.writeln("    <td colspan=3><iframe frameborder=0 width=100% height=100% scrolling="+scr+" src="+fileName+"></iframe></td>");
25
  nbw.document.writeln("  </tr>");
26
  nbw.document.writeln("</table>");
27
}
28
</script>
29
<button onclick=noBorderWin('/','298','232','#333333','#eeeeee','无边窗口例子','#000000','no');>打开窗口</button>
CSS代码
复制 格式化 注释 注释 颜色 清空
放大
CSS代码...
x
 
1
JS代码
复制 格式化 注释 注释 清空
放大
JS代码...
xxxxxxxxxx
1
 
1
名称
JS控制弹出一个IE无法屏蔽的无边框窗口
分类
网站常用
描述
为了提升上网体验,现在很多弹出窗口都被IE插件屏蔽掉了,有些朋友就急了,本来弹出一个窗口是想警示的,并不是什么广告,但也被屏掉了,下面介绍一种用JS控制弹出一个IE无法屏蔽的无边框窗口的方法,虽说不是很理想,但大多数情况下都有...
收藏