CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  JavaScript

[求助]随着菜单的收缩,如何实现Iframe高度的自适应

楼主benxixi(伤心自由人)2005-08-04 17:33:09 在 Web 开发 / JavaScript 提问

紧急求救  
  默认情况下  
  IFrame不出现滚动条  
  可是当菜单(在Ifame里面)展开的时候  
  Iframe出现了滚动条  
  如何让Iframe随着菜单的收缩页面高度自动变化呢?  
  parent.document.all.Left.style.height=""  
  随着菜单的收缩,页面长度在变,如何取得改变的长度呀 问题点数:20、回复次数:2Top

1 楼rayFairy()回复于 2005-08-04 23:17:36 得分 0

既然有菜单了,干吗还用frame?就算改变长度了,效果也肯定很差。  
   
  还有,菜单使用的是什么?div?Top

2 楼qidizi(qidizi)回复于 2005-08-05 00:49:59 得分 20

用下面的可以得到能够拉动的可瞧的部分,而offsetWidth只是可见的部分,你可以比较下,也可以用于BODY  
  可用的ELEMENTS  
   
  A,   ADDRESS,   APPLET,   B,   BDO,   BIG,   BLOCKQUOTE,   BODY,   BUTTON,   CAPTION,   CENTER,   CITE,   CODE,   COL,   COLGROUP,   CUSTOM,   DD,   DFN,   DIR,   DIV,   DL,   DT,   EM,   EMBED,   FIELDSET,   FORM,   HEAD,   hn,   HTML,   I,   IMG,   INPUT   type=button,   INPUT   type=checkbox,   INPUT   type=file,   INPUT   type=image,   INPUT   type=password,   INPUT   type=radio,   INPUT   type=reset,   INPUT   type=submit,   INPUT   type=text,   ISINDEX,   KBD,   LABEL,   LEGEND,   LI,   LISTING,   MENU,   META,   NOBR,   OBJECT,   OL,   OPTION,   P,   PLAINTEXT,   PRE,   S,   SAMP,   SCRIPT,   SELECT,   SMALL,   SPAN,   STRIKE,   STRONG,   SUB,   SUP,   TABLE,   TBODY,   TD,   TEXTAREA,   TFOOT,   TH,   THEAD,   TR,   TT,   U,   UL,   VAR,   XMP  
   
   
  scrollWidth   Property     Internet   Development   Index    
   
  --------------------------------------------------------------------------------  
   
  Retrieves   the   scrolling   width   of   the   object.  
   
  Syntax  
   
  HTML   N/A    
  Scripting   [   iWidth   =   ]   object.scrollWidth    
   
  Possible   Values  
   
  iWidth   Pointer   to   a   nonnegative   long   integer   that   specifies   the   width,   in   pixels.    
   
  The   property   is   read-only.   The   property   has   no   default   value.  
   
  Remarks  
   
  The   width   is   the   distance   between   the   left   and   right   edges   of   the   object's   visible   content.  
   
  For   more   information   about   how   to   access   the   dimension   and   location   of   objects   on   the   page   through   the   Dynamic   HTML   (DHTML)   Object   Model,   see   Measuring   Element   Dimension   and   Location.  
   
  Example  
   
   
  When   the   overflow   property   is   set   to   auto,   the   content   can   exceed   the   dimensions   of   an   element,   and   scroll   bars   appear.   You   can   use   the   scrollWidth   property   to   retrieve   the   width   of   the   content   within   the   element.  
   
  This   example   uses   the   scrollWidth   property   to   compare   the   rendered   width   of   a   div   element   with   the   width   of   the   content.   The   width   of   the   element,   as   rendered   on   the   page,   is   exposed   through   the   offsetWidth   property.  
   
   
  Hide   Example  
   
  <SCRIPT>  
  function   fnCheckScroll(){  
        var   iScrollWidth   =   oDiv.scrollWidth;  
        var   iOffsetWidth   =   oDiv.offsetWidth;  
        var   iDifference   =   iScrollWidth   -   iOffsetWidth;  
        alert("Width:   "   +   iOffsetWidth  
              +   "\nContent   Width:   "   +   iScrollWidth  
              +   "\nDifference:   "   +   iDifference);    
  }  
  </SCRIPT>  
  :  
  <DIV   ID=oDiv   STYLE="overflow:scroll;   height=200;   width=250;    
        text-align:left">  
  :  
  </DIV>  
  <INPUT   TYPE=button   VALUE="Check   scrollWidth"    
        onclick="fnCheckScroll()">  
  Top

相关问题

  • ??????????网页左边栏菜单收缩???????????
  • IFrame 高度自适应
  • 如何实现windows自适应伸缩菜单?
  • iframe如何自适应大小
  • 求教IFRAME自动适应的问题,
  • 求教IFRAME自动适应的问题
  • iframe自适应高度问题
  • iframe自适应高度问题
  • 怎样让image控件实现象Acdsee那样的自动收缩适应。
  • 如何让弹出菜单跨FRAME(包括IFRAME)显示?

关键词

  • 菜单
  • 收缩
  • iframe
  • 长度
  • input type

得分解答快速导航

  • 帖主:benxixi
  • qidizi

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo