Div rewriting controls

Navigation

Skip navigation.

Site search

Site navigation

Details and download

Rewriting the content of a positioned element

Write what you like in here and click the button to see it appear on the page.

This can be used to rewrite parts of the document. The parts that can be re-written are the same parts that can be used to create tooltips and popup menus and even the mini windows in my other examples. The only limitation is that in Opera 6-, the rewritable elements cannot be moved from their original position because of the way it handles iframes.

As the size of the positioned elements can change in Netscape, depending on their contents, but in Internet Explorer they do not (or Opera 6- when using the iframe), the best practice if you want to support all these browsers is to surround all contents with a table where the width and height of the only cell is preset to the width and height of the of the iframe. Eg. my iframe is defined using:

<iframe src="Initial_content.html" name="myFrame" marginwidth="0"
marginheight="0" frameborder="0" height="150" width="150"
scrolling="no"></iframe>

so the content I would want to write has the following format:

<table border="0" cellpadding="0" cellspacing="0">
<tr><td height="150" width="150" valign="top">
    Content goes in here
</td></tr></table>

The script can optionally write that in for you.

This uses the stuff I mentioned in the DHTML section on referencing objects. If the absolutely positioned element can be re-written using either method, that is done. However, if this is not possible but iframes are supported, the iframe content is re-written. If none of these methods is supported, the status bar of the window is re-written as well as is possible.

To download the script(s), see the script license, and check details like browser compatibility, use the links on the navigation panel at the top of this page.

This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.