WillMaster Possibillites Logo EzineSeek Award
Floating Ads
by
William Bontrager

Permission is granted to reprint this article in its entirety, provided no reprints are sent in conjunction with unsolicited bulk email, provided no fee or other value is exchanged, provided no changes are made to the article, and provided the author's name, signature lines, and copyright line are printed with the article; except you may change the article's title.

With the internet public becoming more and more averse to in-your-face advertising, you'll probably want to implement this article with some good taste.

This article shows you how to put an image and/or text into the top-right corner of your web page. When the page is scrolled, your image/text stays in the top-right corner.

The demo page at http://willmaster.com/a/8/pl.pl?84artdemo shows you how it works.

Geocities.com uses a similar idea to float their Yahoo image or other ad on their member's sites. Pages on sites whose hosting services preempt that space may not be able to use the code presented with this article.

The floating ad could be (as examples)

  • a small logo,
  • a link to a news item,
  • a text link to a special area of your site (such as "FAQ" or "Terms of Service"),
  • a "Click to Buy" button image linking to an order page,
  • an ezine subscription form,
  • an affiliate banner, or
  • a link that launches a popup window with additional content.

You'll think of other ways to use it.

The part that floats is placed between CSS <span...></span> tags. Thus, it can contain any HTML code.

Server Side Includes can be used between the <span...></span> tags, which means you can use Master Site News, Master Daily Content, or Master Merry-Go-Round to insert the floating content. (The Master Series of scripts are available at http://willmaster.com/a/8/pl.pl?cgi )

This is what you do:

  1. Retrieve the 27 lines of JavaScript from the demo page at http://willmaster.com/a/8/pl.pl?84artdemo and place it in the <head></head> area of your page.
  2. Put onLoad="StartFloat()" into the <body... tag.
  3. Put these lines into the page content (<body></body>) area:
    <span align="right" id="AdFloater" 
    style="position: absolute; visibility: hidden; top: 1px;">
    [CONTENT]
    </span>
    
  4. Replace [CONTENT] in the above lines with whatever you want to have float on your page.

That's all there's to it!

Done with good taste, it could be an asset to your site.

Copyright 2001 William Bontrager
Programmer/Publisher, "WillMaster Possibilities" ezine
http://willmaster.com/possibilities/
subscribe-possibilities@willmaster.com
Business Home Page: http://willmaster.com/