DR. WEBSITE

Making Background Colors Fade In and Out

Dear Dr. Website®: Recently I visited a page with a very dramatic background effect. When the page loaded, the background seemed to fade very quickly from black to white. How did they do this, and how can I add this kind of effect to my site?

The effect you describe is one that can be achieved easily through JavaScript. Kouichiro Eto's fade script is a publicly available JavaScript script that can generate this kind of gradual background color fading. One bonus is that you'll have a good deal of flexibility for modifying the colors used and for varying the rate at which the color change takes place.

Browser offset

Dear Dr. Website®: I'm trying to align a GIF on a Web page so that it reaches to the very end of the left side of the browser window. Even though the picture is left-aligned, it looks like there's a small margin between the picture and the edge of the browser window. How can I get rid of that gap?

As you've discovered by now, most browsers will automatically offset the contents of a Web page by several pixels along the window's top and left margins. This can result in a lot of headaches for a designer who tries to position a GIF precisely within the browser window or a background image. Interestingly, the number of pixels your image is offset when viewed by your readers will differ, depending on which browser is used; this can even vary among several versions the same browser. Designer David Siegel offers real-world examples of how these variations in browser versions affect your page's display at Browser Offsets: The Good, The Bad, and the Ugly.

Microsoft's Internet Explorer has two proprietary tags, LEFTMARGIN and TOPMARGIN, that give you control over these margin settings. You can change the default settings to any desired value, or eliminate the margin altogether by setting LEFTMARGIN and TOPMARGIN both to 0.

Netscape's Navigator currently has no comparable proprietary tags, although using frames--with their accompanying margin attributes--is one way to control margins to some extent in pages viewed in browsers that support frames. Bear in mind, though, that workarounds and tags that optimize your site's appearance for a particular browser comes at the expense of designing your pages for universal access.

Automating content retrieval

Dear Dr. Website®: We have a company intranet and download certain information off the Internet on a daily basis to make this available to our users who are not given Internet access. Is there a way to do this dynamically--for example, in some sort of batch job?

Here's one way to automate this function: You could configure an offline browser to access those sites you visit on a daily basis for updated content. The machine that the offline browser uses for saving the downloaded content will then need to be made network-accessible, so that the content can be accessed by the other employees on your intranet.

There are a number of commercial offline browsers on the market, including First Floor Software's Smart Bookmarks, InContext's WebAnalyzer and The ForeFront Group's WebWhacker, to name a few.

These tools have options for how many levels deep or how many files to retrieve from a given Web site. You should also be able to indicate how often you'll want the browser to refresh those stored pages, which in your case sounds like it would be on a daily basis.

Run to the border?

Dear Dr. Website®: I know that frames are getting more popular, but do you think it's still too soon at this time to convert my Web site? Is it worth the trouble?

Debating a large-scale change to your site's design interface, such as frame-enabling all content, should be driven more by considering how the redesign would better serve your site's function than by simply wanting to use a new or popular technology.

Frames will alter the way visitors to your site will see your information organized and how they will navigate the site's contents. For example, if you determine you would have a use for a toolbar or other navigational aid to remain in a fixed position on all your pages, putting that fixed content within a frame--while using other frames or framesets to display independent content--would serve as a very effective interactive aid.

If you become adept at designing frames, you may want to create even more sophisticated framesets--for example, refreshing several frames at once to load several new documents, or adding distinct headers and footers to your pages. This could have great potential for making clear to your readers the connections between various documents and the relative importance of the different kinds of information on your site.

On the other hand, if your site's organization is very linear, it won't gain much in appeal by your utilization of frames technology. For example, if you make your frames too small and compel visitors to scroll excessively--potentially leading to missed resources and unsatisfied visitors--this information structure will not be successful. It's a helpful exercise to articulate what you see as the trade-offs involved in incorporating frames on your site.

You should also keep user considerations in mind, since framed pages can take longer to load than their plain-Jane HTML equivalents. With the passing of time, users have become more familiar with how to navigate frames--and Navigator and Internet Explorer have both refined their frames implementations--but you should be certain that the interface won't be a burden to at least the large majority of your users.

There are a number of excellent online tutorials for developing expertise in designing sites with frames; many of these will offer additional suggestions for judging whether frame-enabling your site will be worth the investment of your time.

Here's just a small sampling: Webspinners' Introduction to Frames includes a layout guide, as well as examples and templates for creating frames quickly. NewbieNet hosts a guide to learning how to design frames on its site called The Netscape Frames Tutorial. Netscape offers a thorough guide on its Frames Syntax page, as does Microsoft, on its page devoted to HTML Authoring Features


Please send your site design and development questions to drweb@internet.com, or visit the Ask Dr. Website page.
Reprinted from Web Week, Volume 2, Issue 14, September 23, 1996 © internet.com Corporation All rights reserved. Keywords: HTML, content Date: 19960923

http://www.internet.com/