SPAW editor. Net edition V.2 describes an HTML editor, which may be used for page layout.CodeControl the editor size. For example, when you adjust the browser size, you may want the editor size to change with the browser size. The default width attribute of SPAW editor is 100%, so we need to consider how to adjust the height of the control using code.
OK. Suppose there is a server-side SPAW editor control with ID spawmain on the page. How can we use the browser-side Javascript script to control the height of the control? If you have enough foundation and patience, you can read the SPAW editor.. net source code. Otherwise, it is recommended that you use a browser development auxiliary tool similar to IE developer toolbar to view HTML Dom on the browser side. Through the IE developer toolbar, we can clearly see (figure) that the SPAW editor subject is also an IFRAME element without exception. Through observation, you can also find that the IFRAME and the toolbar and status bar of the control are all placed in the cell of the table element, so the problem of adjusting the editor height becomes the problem of adjusting the height of the IFRAME element. Adjust the height of an IFRAME element on the HTML page. We need to know the ID attribute value of this IFRAME element. In this example, we can see that the ID attribute value of this IFRAME element is spawmain_redit, the format is "[server-side control ID attribute value] _ redit", which is located in the spaw2/JS/common/Editor directory. the following code in js also verifies this point:
// Returns reference to outer IFRAME object (differs from getpageifram in IE only)
Spaweditor. Prototype. getpageiframeobject = Function (Page_name)
{
Return This . Document. getelementbyid (Page_name + '_ redit' );
}
Now, on the browser side, we can use the following JavaScript code to change the height of the element:
Document. getelementbyid ( " [Server-side control ID attribute value]_ Redit " ). Style. Height = [Set the height value];