<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>iframe和table模拟frameset的resize功能</TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> </HEAD> <BODY> <table id="main" style="width:100%; height:100%" cellSpacing="0" cellPadding="0" border="0"> <tr> <td style="width:125px" id="tdLeft"> <iframe id="ifmLeft" style="width:125px; height:100%" src="sss.html" frameBorder="0" scrolling="auto"></iframe> </td> <td id="tdResizer" style="width:2px; cursor:e-resize; background-color:#A1C7F9;">?</td> <td width="100%"> <iframe id="ifmRight" style="width:100%; height:100%" src="sss.html" frameBorder="0" scrolling="auto"></iframe> </td> </tr> </table> <script language="javaScript"> var theResizeObj = null; //代表一个 resizeObject() 的实例 This gets a value as soon as a resize start function resizeObject() { this.target = null; //需要 resize 的 object //this.dir = ""; //移动方向 type of current resize (n, s, e, w, ne, nw, se, sw) this.mouseOld_X = null; //鼠标移动时初始 x 坐标 this.mouseOld_Y = null; //鼠标移动时初始 y 坐标 this.oldWidth = null; //需要 resize 的 object 初始 width this.oldHeight = null; //需要 resize 的 object 初始 height //this.oldLeft = null; //定位用的 //this.oldTop = null; this.xMin = 1; //The smallest width possible this.yMin = 1; //The smallest height possible this.xMax = window.screen.availWidth * 0.95; //the max width possible } //准备拖动 function resizeStart() { if(window.event.srcElement.id == "tdResizer") { theResizeObj = new resizeObject(); theResizeObj.target = document.all("ifmLeft"); theResizeObj.mouseOld_X = event.clientX; theResizeObj.oldWidth = theResizeObj.target.offsetWidth; } else { theResizeObj = null; } window.event.returnValue = false; window.event.cancelBubble = true; document.all('tdResizer').setCapture(); } //拖动 function resize() { if(theResizeObj != null) { var newWidth = theResizeObj.oldWidth + window.event.clientX - theResizeObj.mouseOld_X; newWidth = Math.min(newWidth, theResizeObj.xMax); newWidth = Math.max(newWidth, theResizeObj.xMin); theResizeObj.target.style.width = newWidth + "px"; } window.event.returnValue = false; window.event.cancelBubble = true; } //停止拖动; function resizeStop() { if(theResizeObj != null) { theResizeObj = null; } //释放鼠标拖动 document.all('tdResizer').releaseCapture(); } document.onmousedown = resizeStart; document.onmousemove = resize; document.onmouseup = resizeStop; </script> </BODY> </HTML>
详细解决方案
施用iframe和table模拟frameset的resize功能
热度:105 发布时间:2012-08-21 13:00:22.0
相关解决方案
- iframe 子页刷新父页有关问题 大神请帮忙看看
- frameset 的一个小疑点,高分,有答案结贴
- servlet 定向 frameset 中的解决方法
- jsp页面放在html《iframe》中中文没法正常显示 单独是可以显示正常的O(∩_∩)O~该怎么解决
- jsp页面中加了<table>元素后,页面出现了一大片空白后才出现表格?解决方法
- jsp页面中加了<table>元素后,页面出现了一大片空缺后才出现表格
- 请问一个页面有关问题-iframe
- struts action 跳转 页面后 frameset 404 异常
- Unknown table 'book' in field list
- VS2010 RDLC 报表 表(table) 分页的时候怎么显示表头
- iframe 鼠标打击有关问题
- AJAX 的TabContainer控件 嵌套 iframe 标签页 标签页面过长时自动顺应
- iframe 中使用UEditor有关问题
- 在继承母版页的页面里使用框架(frameset)的有关问题,解决即结贴
- Iframe top.history.go(@Num)有关问题
- iframe Session丢失 跳转到登陆页面有关问题
- Table 布局怎么改用CSS定位
- sql清空表数据用truncate table 表名处理,若表名是以数字开头,或者完全是数字,这句会报语法异常
- iframe 局部刷新 带图片的刷新按钮 如何弄
- sqltxet能不能这么写成"select *rowid from table"
- 大哥们救上命啊ArgumentException: 列“xxx”不属于表 Table
- 为何在ASP.NET中不能用<frameset></frameset>框架标签
- 大家都把导航条,页头页脚做到哪里,独立页面用<iframe>调用,还是母板页,望前辈指点,该怎么解决
- 要取TextBox里的值插入表, insert into table value(); 括号里应该如何写
- 【聊天室】大师们,该怎么点击“提交”按钮把信息显示在 <iframe>里面 呢
- 在类名上这样写是啥[Table(Name = "Product")]解决方法
- html中<table>和<asp:Tabel>有什么不一样啊该如何解决
- frameset 和treeview的有关问题
- JS预览 Table
- 关于 iframe url的有关问题