onresize Event  Internet Development Index --------------------------------------------------------------------------------Fires when the size of the object is about to change. SyntaxInline HTML <ELEMENT onresize = "handler" ... >  All platforms 
Event property object.onresize = handler JScript only 
object.onresize = GetRef("handler") Visual Basic Scripting Edition (VBScript) 5.0 or later only 
Named script <SCRIPT FOR = object EVENT = onresize>  Internet Explorer only Event InformationBubbles No 
Cancels No 
To invoke Change the height or width of the object.  
Default action No default action.  Event Object PropertiesAlthough event handlers in the DHTML Object Model do not receive parameters directly, a handler can query an event object for data.Show Available PropertiesaltKey Sets or retrieves a value that indicates the state of the ALT key.  
altLeft Sets or retrieves a value that indicates the state of the left ALT key. 
clientX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars. 
clientY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars. 
ctrlKey Sets or retrieves the state of the CTRL key.  
ctrlLeft Sets or retrieves the state of the left CTRL key.  
offsetX Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event.  
offsetY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the object firing the event.  
returnValue Sets or retrieves the return value from the event.  
screenX Retrieves the x-coordinate of the mouse pointer's position relative to the user's screen.  
screenY Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen.  
shiftKey Sets or retrieves the state of the SHIFT key.  
shiftLeft Retrieves the state of the left SHIFT key.  
srcElement Sets or retrieves the object that fired the event.  
type Sets or retrieves the event name from the event object.  
x Sets or retrieves the x-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element. 
y Sets or retrieves the y-coordinate, in pixels, of the mouse pointer's position relative to a relatively positioned parent element. ResThe onresize event fires for block and inline objects with layout, even if document or CSS (cascading style sheets) property values are changed. Objects have layout when measurements such as the height and width attributes are set, or when the position of the object is set. Intrinsic objects, such as button, and windowed objects, such as window and iframe, fire as expected. This event does not fire for files with embedded controls.Resizing HTML applications also fires the onresize event.

解决方案 »

  1.   

    <table><tr><td><iframe style="height:100%">
      

  2.   

    iframe 的 height 为 100%  后,那它里面的网页(src="1.htm")就没有滚动条了:(楼上好厉害啊,可是我的英语好差的:(
      

  3.   

    <iframe src='http://www.e-picc.com.cn/ebiz/servlet/com.general.ebiz.ms.info.tradetrends.TradeTrendsServlet?saction=15&category=4'  
            NAME='PICC_CoverInfo'
            ID='PICC_CoverInfo'
            FRAMEBORDER=0        
            marginWidth="0"
            marginHeight="0"
            scrolling=no
            width="100%"
            onload='var f=document.all["PICC_CoverInfo"]; var b=f.Document.body; f.height=b.scrollHeight'> 
    </iframe>
      

  4.   

    <iframe name=ifm onload="this.height=ifm.document.body.scrollHeight+10">
      

  5.   

    楼上说的方法怎么不行啊?
    得到的高度总是只有200象素左右。能不能让iframe的高度总是比在它外面的table小20象素(iframe随着table变化),而table为100% ?
      

  6.   

    能不能根据iframe的高度调整包含iframe部分的高度,可能是table或tr或td?
      

  7.   

    我不知道理解的是否正确.如果你是在A页面中加了B,B是iframe.
    B是被加在A中的TABLE中间的.你想在A页面的大小进行改动的时候.iframe的宽度也进行相应改动.这里有两个方法.第一,因为你的table的width是:100%,那么如果你想要让里面的iframe也进行自动伸缩.把width的值也设置为100%就好了.如果有问题.你可以看你的iframe所调用的页面中的代码写发.如果在B页面中的BODY设置为:10.那么即使你的iframe设置为:100%.里面所看见的也只有10.虽然你的框架是:100%.第二,你可以通过onResize时间来更改你的iframe框架.
    先给iframe给一个标识.然后根据时间的出发更改他的width的值.
      

  8.   

    bflovesnow(北风) 的方法:
    <iframe name=ifm onload="this.height=ifm.document.body.scrollHeight+10">看起来是合理地,只是不知道阁下是否有运行过呀?我在我的环境:Win2000 Adv Server, IE 6.0.2800 下试过是不行的,会报错!!!