Hello, I'm trying to make Javascript change the style of certain DIV IDs by changing their background every few seconds. Basically, a fading header...here's my code, and it just doesn't change the background, at all.
How do you call a function?
Hello, I'm trying to make Javascript change the style of certain DIV IDs by changing their background every few seconds. Basically, a fading header...here's my code, and it just doesn't change the background, at all.
How do you call a function?
Your javascript is in functions and isn't being called from anywhere. Try calling one of the functions from window.onload, or $(document).ready(function(){ }); if you're using jQuery
you could do something like this
<body onload="Appear(id1, id2);">
that way when the page loads it starts the fadein/out
With the version I just saw up there, the onload call to Appear(id1, id2) is failing because id1 and id2 are not yet defined.
Either define id1 and id2, e.g ... pics_array[2] = pic2; var id1 = 0; var id2 = 0;
but since its an onload function only getting called once, you may as well change the body tag to
The only problem then is the code falls over on this line: new Effect.Appear('appear-div');
probably because the file effects.js can't be found.