mtd
01-09-2004, 01:41 AM
I am trying (unsuccessfully) to create an IE/NS script that will change the contents of a <div> when the mouse is placed over an image. I have seen scripts like this before, which are pretty simple, but they only work in IE, not Netscape.
This is what I have so far, and I was hoping someone could help:
In the <head> :
<script language="javascript">
var oDiv1 = document.getElementById('services'), oDiv2 = document.getElementById('portfolio')
function Go1()
{
oDiv2.style.display='none';
oDiv1.style.display='inline';
}
function Go2()
{
oDiv2.style.display='inline';
oDiv1.style.display='none';
}
</script>
In the <body> :
<img src="images/nav/services.gif" onMouseOver="Go1();">
<img src="images/nav/services.gif" onMouseOver="Go1();">
<div id="services" style="display:none">services info</div>
<div id="portfolio" style="display:none">portfolio info</div>
Any help is appreciated - I am fairly new at this!
Thanks,
MTD
This is what I have so far, and I was hoping someone could help:
In the <head> :
<script language="javascript">
var oDiv1 = document.getElementById('services'), oDiv2 = document.getElementById('portfolio')
function Go1()
{
oDiv2.style.display='none';
oDiv1.style.display='inline';
}
function Go2()
{
oDiv2.style.display='inline';
oDiv1.style.display='none';
}
</script>
In the <body> :
<img src="images/nav/services.gif" onMouseOver="Go1();">
<img src="images/nav/services.gif" onMouseOver="Go1();">
<div id="services" style="display:none">services info</div>
<div id="portfolio" style="display:none">portfolio info</div>
Any help is appreciated - I am fairly new at this!
Thanks,
MTD