Take a look at this url in both FIreFox and Internet Explorer
http://www.abdcweb.com/Demo/html/clientlist.htmlIt is supposed to:
1. Fade background from white to black when the page loads
2. Fade content in after background fade is complete
When the user clicks on a menu link other than our work:
1. Fade content out before exit
2. Fade background to white before exit
3. jump user to other html page
IT WORKS THE WAY IT SHOULD IN EXPLORER! However the background doesn't fade in or out.
The background is associated with the body tag. I get the same issue with
www.abdcweb.com. It does not align the <body> tag CSS text-align: center.
What are the best practices to get around this and make these things work in mozilla browsers?
==========================
==
JAVASCRIPT CODE FILE
==========================
==
// JavaScript Document
// Created by Alex Banks Development Company
//
www.abdcweb.com//This script initiates colors as white.
red = 255;
green = 255;
blue = 255;
inc = 10;
delay = 30;
ie5 = (document.all && document.getElementById);
ns6 = (!document.all && document.getElementById);
opac = 0;
opac2 = 100;
contentLayer = "ct";
selectedURL = "";
//This Function Fades the Background Color To Black
//Control timeing of fade with the delay value
function FadeBlack()
{
red -= inc;
green -= inc;
blue -= inc;
if (red <= 0)
{
FadeContentIn();
return;
}
document.bgColor = get_hex_color (red, green, blue);
setTimeout ("FadeBlack()", delay);
}
function FadeContentIn() {
if(opac < 100){
opac+=inc;
if(ie5) document.getElementById('c
t').filter
s.alpha.op
acity = opac;
if(ns6) document.getElementById('c
t').style.
MozOpacity
= opac/100;
setTimeout('FadeContentIn(
)', delay);
}
}
function FadeContentOut() {
if(opac2 > 0){
opac2-=inc;
if(ie5) document.getElementById('c
t').filter
s.alpha.op
acity = opac2;
if(ns6) document.getElementById('c
t').style.
MozOpacity
= opac2/100;
setTimeout('FadeContentOut
()', delay);
} else {
FadeWhite();
}
}
function NavClick(URL) {
selectedURL = URL;
FadeContentOut();
}
//This Function Fades the Background Color To Black
//Control timeing of fade with the delay value
function FadeWhite()
{
red += inc;
green += inc;
blue += inc;
if (red >= 255)
{
GetURL(selectedURL);
return;
}
document.bgColor = get_hex_color (red, green, blue);
setTimeout ("FadeWhite()", delay);
}
function GetURL(URL) {
window.location = URL;
}
//This functino will translate color values to Hexidecimal Format
function get_hex_color (r, g, b)
{
var hexstring = "0123456789abcdef";
var hex_color =
hexstring . charAt (Math . floor (r / 16))
+ hexstring . charAt (r % 16)
+ hexstring . charAt (Math . floor (g / 16))
+ hexstring . charAt (g % 16)
+ hexstring . charAt (Math . floor (b / 16))
+ hexstring . charAt (b % 16);
return hex_color;
}