Hi, I'm relatively new to Javascript, and am trying to put together a series of rollover images for a website I'm working on for a links sidebar type thing. I'll put the code below. I've got a few problems - firstly, the images aren't rolling over, secondly the status bar text isn't showing the message I put in there (ie "Hello" at this stage)...any help on where I'm wrong would be greatly appreciated. Anyway, here's the code...
<HTML>
<BODY BACKGROUND="pics/bg.jpg" BGPROPERTIES="fixed" ONLOAD="preLoad();statusText()">
<A HREF = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"index.htm"><IMG NAME="welcImg" onmouseover="RollOn(1)" onmouseout="RollOut(1)" SRC="pics/welcome1.gif" BORDER="0"></A><BR>
<A HREF = "events.htm"><IMG NAME="eventImg" onmouseover="RollOn(2)" onmouseout="RollOut(2)" SRC="pics/events1.gif" BORDER="0"></A><BR><BR>
<SCRIPT language="JavaScript">
status_text();
function status_text()
{
window.status="Hello";
setTimeout("status_text()",1);
}
var n;
function preLoad()
{
welc1=new Image;
welc2=new Image;
welc1.src="pics/welcome1.gif";
welc2.src="pics/welcome2.gif";
event1.src=new Image;
event2.src=new Image;
event1.src="pics/events1.gif";
event2.src="pics/events2.gif
}
function RollOn(n)
{
if (n == 1) {
document.welcImg.src=welc2.src;
}
if (n == 2) {
document.eventImg.src=event2.src
}
}
function RollOff(n)
{
if (n == 1) {
document.image.src=welcImg.src;
}
if (n == 2) {
document.image.src=eventImg.src;
}
}
</SCRIPT>
</BODY>
</HTML>
Thanks again for any help...(I've hopefully attached a text version of the file too if that's any easier to work with...)
<HTML>
<BODY BACKGROUND="pics/bg.jpg" BGPROPERTIES="fixed" ONLOAD="preLoad();statusText()">
<A HREF = <!-- m --><a class="postlink" href="http://www.webdeveloper.com/forum/archive/index.php/">http://www.webdeveloper.com/forum/archive/index.php/</a><!-- m -->"index.htm"><IMG NAME="welcImg" onmouseover="RollOn(1)" onmouseout="RollOut(1)" SRC="pics/welcome1.gif" BORDER="0"></A><BR>
<A HREF = "events.htm"><IMG NAME="eventImg" onmouseover="RollOn(2)" onmouseout="RollOut(2)" SRC="pics/events1.gif" BORDER="0"></A><BR><BR>
<SCRIPT language="JavaScript">
status_text();
function status_text()
{
window.status="Hello";
setTimeout("status_text()",1);
}
var n;
function preLoad()
{
welc1=new Image;
welc2=new Image;
welc1.src="pics/welcome1.gif";
welc2.src="pics/welcome2.gif";
event1.src=new Image;
event2.src=new Image;
event1.src="pics/events1.gif";
event2.src="pics/events2.gif
}
function RollOn(n)
{
if (n == 1) {
document.welcImg.src=welc2.src;
}
if (n == 2) {
document.eventImg.src=event2.src
}
}
function RollOff(n)
{
if (n == 1) {
document.image.src=welcImg.src;
}
if (n == 2) {
document.image.src=eventImg.src;
}
}
</SCRIPT>
</BODY>
</HTML>
Thanks again for any help...(I've hopefully attached a text version of the file too if that's any easier to work with...)