Example 6: XHTML Content

In this example, the versatility of the tooltip content is demonstrated by using XHTML in the content. Including XHTML allows for embedding of markup, images, and even an iframe! The tooltip on the left contains an embedded image by referencing the content of an existing html element. The second link uses the same html, but includes it inline. The last link acts as an inline window, loading the Google homepage!*

Take a look! | Take another look! | Inline window (local) | Inline window (external)

Note: The first tooltip passes in a DOM object for the content. The content of this tip is placed in a hidden element and then moved into the tip when it becomes active.

Note: Notice how the webpage in the iframe reload each time the tooltip is opened. This happens because the 'closeAction' option is set to 'destroy'. If we change 'closeAction' to 'hide', then the webpage will remain active when it is not visible. This option can be useful when the content in the webpage needs to be cleared after working with it, for instance if we wanted to clear the search we made each time and start fresh.

Note: To load a secondary URL from an onclick event, as is the case in this iframe, it is necessary to cancel the click event by wrapping the call to 'domTT_activate()' in 'makeFalse()'.

«Example 5
Example 7»