PDA

View Full Version : Yet ANOTHER HTML issue



Cruise Control
12-04-2005, 11:23 PM
I have a background issue, after the image ends, it should appear black but is showing up white. I downloaded this by the way, so in no way do I take credit for all of it. It worked fine till I added another link and the fade in thing. Site can be found here: Web-Page (http://www.geocities.com/bbomber72000//index.html)

You'll have to click veiw menu, source because I disabled right-clicking.

rubah
12-05-2005, 12:34 AM
*right clicks since she is l33t and uses firefox*
That coding is really messy. Maybe it's because I've spent the last week cleaning my site's code, but that stuff makes me want to gag:(

all you need is a background-color:black; in the body section of your stylesheet.

bipper
12-05-2005, 05:20 AM
You set <BODY BGCOLOR=black> using the primative HTML attributes for the body tag. :thwack: Don't do this, use Rubah's method, better known as CSS.

Teh problem lies in your Javascript. I read through your source, and it WAS messy as Rubah had also mentioned. It looks like you have a script which cycles through background colors to make a fade in effect - this is evil and will not work right on firefox.

The problem is simply the script ends up in a white screen - which overrides your black background because the background will start off black as the HTML specifies THEN the javascript will kick in and make the fading background. I would also kill the music, or put a control up and set it to off on default :)

I am pretty sure this will get you the answer, if not closer.

Bipper

Cruise Control
12-05-2005, 09:33 PM
I was thinking about in school and realized that that was the probable answer. And yes I know it's messy, I'm working on it.

rubah
12-05-2005, 11:17 PM
run it through the w3c's validation. and code it in firefox:] it'll make it a lot less stressful when you run into the "omg, w3c says it's wrong, but it looks right!" errors.

Cruise Control
12-06-2005, 12:07 AM
I have no idea what any of that means. I just killed of the cool thing when you enter the page. That solved the problem. Unless someone can edit the cool flashy thing to make it happen and keep the background black.

Heres the original:

<img src="/xxx.gif"><img src="/xxx.gif"><img src="/xxx.gif"><img src="/xxx.gif"><img src="/xxx.gif"><img src="/xxx.gif"><img src="/xxx.gif"><img src="/xxx.gif">>
<!--
function describe(aString) {
top.status = aString;
return true;
}

function makearray(n) {
this.length = n;
for(var i = 1; i <= n; i++)
this[i] = 0;
return this;
}

hexa = new makearray(16);

for(var i = 0; i < 10; i++)
hexa[i] = i;

hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
hexa[13]="d"; hexa[14]="e"; hexa[15]="f";

function hex(i) {
if (i < 0)
return "00";
else if (i > 255)
return "kk";
else
return "" + hexa[Math.floor(i/16)] + hexa[i%16];
}

function setbgColor(r, g, b) {
var hr = hex(r); var hg = hex(g); var hb = hex(b);
document.bgColor = "#"+hr+hg+hb;
}

function fade(sr, sg, sb, er, eg, eb, step) {
for(var i = 0; i <= step; i++) {
setbgColor(
Math.floor(sr * ((step-i)/step) + er * (i/step)),
Math.floor(sg * ((step-i)/step) + eg * (i/step)),
Math.floor(sb * ((step-i)/step) + eb * (i/step)));
}
}

fade(4,4,200,255,255,255,100);

//-->
</script>
I don't know why but it replaces < script > with the swear filter for <img src="/xxx.gif"><img src="/xxx.gif"><img src="/xxx.gif"><img src="/xxx.gif">.

bipper
12-06-2005, 03:07 AM
quick and dirty fix;

setbgColor(0, 0, 0);

Add that line to the end of your javascript. Somthing along those lines should do the trick.
If not I can give ya a better hand in the morning - off to work!

Bipper