==================================
Element Behaviors - Ad Banner
==================================
Last Updated: Aug.01,2000
SUMMARY
========
Element behaviors are a new technology in Microsoft® Internet Explorer 5.5. They
allow Web authors to encapsulate reusable functionality inside an HTML component
(HTC) file. A lightweight HTC--an HTC with less memory overhead that doesn't come
with its own document--allows users to create lightweight components and reuse them
many times on the same page.
DETAILS
========
In the demo, the script that implements the "my:addbanner" custom tags is encapsulated
in a separate file. The sample renders any HTML content inside of it in the top right
position by default. By specifying values for the "bannerfromTop" and "bannerfromRight"
properties on the behavior the banner can be made to render at a different position than
the default position which is to the top right most corner of the page. The behaviors
re-positions the content inside it when the page is either resized or scrolled. In order
to allow the scrolling and resize events be notified of the behavior, attach the onresize
and onscroll functions on the body of the HTML Page to call the behaviors relocate public
method. In the page, additional functionality, (footerClick() function), is added to show
and hide the floating advertisement. This is optional and can be removed to have the
advertisement always floating.
USAGE
======
Use of this behavior requires some basic declarations:
- "Xmlns" declaration inside the HTML tag.
- Import declaration with the appropriate namespace, as specified in the xmlns
declaration and the path to the Adbanner.htc file.
- The custom tags themselves should be included in the body of the HTML page,
With some text here.