用iframe,访造子窗口,怎样实现窗口拉大拉小

binxiao 2004-07-19 03:51:42
用iframe,访造子窗口,怎样实现窗口拉大拉小
...全文
152 4 打赏 收藏 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
binxiao 2004-07-20
  • 打赏
  • 举报
回复
我想拉大拉小时,鼠标变成传统的 样式,那怎样改.....
wanghr100 2004-07-20
  • 打赏
  • 举报
回复
demo.htm

<iframe src="in.htm" name="in"></iframe>

in.htm

<title></title>
<body style="cursor:nw-resize" onmousedown="ChangeWH()">
<script>
function ChangeWH()
{
document.attachEvent("onmousemove",moveHandler);
document.attachEvent("onmouseup",upHandler);
event.cancelBubble = true;
event.returnValue = false;
function moveHandler(e)
{
parent.document.all("in").style.height = e.clientY;
parent.document.all("in").style.width = e.clientX;
e.cancelBubble = true;
}
function upHandler(e)
{
document.detachEvent("onmouseup",upHandler);
document.detachEvent("onmousemove",moveHandler);
e.cancelBubble = true;
}
}
</script>

gjd111686 2004-07-19
  • 打赏
  • 举报
回复
<style>
.SwitchClass{color:black;cursor:hand;font-family:webdings;font-size:9pt}
</style>
<body>
<script language="javascript">
function SwitchMenuStatus()
{
if(SwitchMenu.innerText==3)
{
SwitchMenu.innerText=4;
document.all("Menu").style.display="none";
}
else
{
SwitchMenu.innerText=3;
document.all("Menu").style.display="";
}
}


function OpenMenu()
{
if(SwitchMenu.innerText==4)
{
SwitchMenu.innerText=3;
document.all("Menu").style.display="";
}
else
{
SwitchMenu.innerText=3;
document.all("Menu").style.display="";
}
}

</script>
<table width="100%" border="1" cellpadding="3" cellspacing="0" height="100%" bordercolor="#EEEEEE" bordercolordark="#FFFFFF" bordercolorlight="#999999">
<tr>
<td id=Menu name="Menu" vAlign=top align=left>
<iframe src="about:blank" style="height:100%;visibility:inherit;width:100" border="0" frameborder=0></iframe>
</td>
<td width="5" height="100%" onmouseover="OpenMenu();">
<table border=0 cellPadding=0 cellSpacing=0>
<tr>
<td style="height: 100%;" valign=middle onclick="SwitchMenuStatus();">
<span class=SwitchClass id=SwitchMenu title="关闭/打开菜单">3</span>
</td>
</tr>
</table>
</td>
<td id=Home name="Home" vAlign=top align=left width="100%">
<iframe src="about:blank" style="height:100%;visibility:inherit;width:100%" border="0" frameborder=0></iframe>
</td>
<tr>
</table>
Bmonkey 2004-07-19
  • 打赏
  • 举报
回复
建议你用frameset,用iframe应该只有用一个td里面放img来模仿:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script>
function doDrag()
{
var objIframe=document.all.iframe1;
objIframe.width=event.clientX;
}
</script>
</HEAD>

<body>
<table width="100%" height="100%" cellpadding=0 cellspacing=0>
<tr>
<td width="0" height="100%" id="td1">
<iframe src="http://www.tom.com" width="0" height="100%" frameborder=0 id="iframe1"></iframe>
</td>
<td width="10" height="100%">
<img src="mid.gif" width="10" height="100%" ondrag="doDrag();">//此处换成你的img
</td>
<td width="100%" height="100%">
<iframe src="http://www.yahoo.com.cn" width="100%" height="100%"></iframe>
</td>
</tr>
</table>
</body>
</HTML>

87,984

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧