您的位置:首页 > 其它

用层(DIV)来实现弹出窗口

2006-09-22 17:00 316 查看
现在网上有很的软件用来阻止网页中的弹出窗口,本来倒是好事,用户可以根据需要来阻止那些广告什么的。但有很多这种小软件是流氓软件,不知不觉中这装上去了,很多人还装了很多,但又不会设置。这就要我们程序员,来很办法避开这些软件,让用户看到我们所要展示的内容。用户层来模拟弹出窗口,是个不错的选择。
如下图所示:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>windemo1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<link type="text/css" href="win/win.css" rel="stylesheet">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<A onclick="if (winList['sample2']) winList['sample2'].open('table.aspx'); return false;"
href="#">客户信息列表</A>
<DIV class="window" id="sample2" style="WIDTH: 870px">
<DIV class="titleBar">
<SPAN class="titleBarText"><img src="win/MSN.ICO" height="14"> 客户信息</SPAN> <IMG class="titleBarButtons" alt="" useMap="#sampleMap2" src="win/buttons.gif">
<MAP id="sampleMap2" name="sampleMap2">
<AREA title="Minimize" onclick="this.parentWindow.minimize();return false;" shape="RECT"
alt="最小化" coords="0,0,15,13">
<AREA title="Restore" onclick="this.parentWindow.restore();return false;" shape="RECT"
alt="还原" coords="16,0,31,13">
<AREA title="Close" onclick="this.parentWindow.close();return false;" shape="RECT" alt="关闭"
coords="34,0,49,13">
</MAP>
</DIV>
<DIV class="clientArea" style="HEIGHT: 530px">
<iframe id="iurl" frameborder="0" style="MARGIN: 0px" src="" width="100%" height="100%">
</iframe>
</DIV>
</DIV>
</form>
</body>
</HTML>
可以修改<div class="clientArea"></div>中的内容,去掉<iframe>标记,直接添加显示内容,在调用onclick,打开窗体时,用open(),不带参数。
win.css

.window
.titleBar
.titleBarButtons
.clientArea

win.js

//<![CDATA[
//*****************************************************************************
// Do not remove this notice.
//
// Copyright 2001 by Mike Hall.
// See http://www.brainjar.com for terms of use.
//*****************************************************************************

// Determine browser and version.

var browser = new Browser();

//=============================================================================
// Window Object
//=============================================================================

//=============================================================================
// Window Methods
//=============================================================================

//=============================================================================
// Event handlers.
//=============================================================================

//-----------------------------------------------------------------------------
// Window dragging.
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// Window resizing.
//-----------------------------------------------------------------------------

//=============================================================================
// Utility functions.
//=============================================================================

//=============================================================================
// Initialization code.
//=============================================================================

var winList = new Array();
var winCtrl = new Object();

window.onload = winInit; // run initialization code after page loads.

//]]>
下载/Files/yknb/JavaScriptDemo.rar
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: