Muffin_LA
23-07-2005, 15:51/03:51PM
Hi again:
Ok I am working on my final project. What I am trying to do is this:
I have 3 children and I want to have 3 main pictures of them and when you move your mouse over the pics it shows another picture. I can get the first one to work fine but I get errors on the second one. This is the codes I have so far.
function SwapImg(idx, img)
{
document.images[idx].src = img;
}
#logan {
position: absolute;
z-index: 1;
top: 150px;
left: 225px;
width: 100;
}
#babylogan{
position: absolute;
z-index: 0;
top: 150px;
left: 225px;
width: 100;
}
#cass {
position: absolute;
z-index: 3;
top: 150px;
left: 225px;
width: 100;
}
#babycass{
position: absolute;
z-index: 2;
top: 150px;
left: 225px;
width: 100;
}
<a href="#" onMouseOver="SwapImg(0, 'babylogan.jpg')"
onMouseOut="SwapImg(0, 'logan.jpg')">
<img border="0" src="logan.jpg" height="300" width="400" alt="Logan" /></a>
<a href="#" onMouseOver="SwapImg(2, 'babycass.jpg')"
onMouseOut="SwapImg(2, 'cass.jpg')">
<img border="0" src="cass.jpg" height="300" width="400" alt="Cassandra" /></a>
Logan's pics work but Cassandra's doesnt. I also have to add one more set of pics for my other daughter.
Thank you again for all your help. The next course I am taking is Javascript so hopefully I will be able to figure this out on my own after I finish it.
Linda:confused:
Ok I am working on my final project. What I am trying to do is this:
I have 3 children and I want to have 3 main pictures of them and when you move your mouse over the pics it shows another picture. I can get the first one to work fine but I get errors on the second one. This is the codes I have so far.
function SwapImg(idx, img)
{
document.images[idx].src = img;
}
#logan {
position: absolute;
z-index: 1;
top: 150px;
left: 225px;
width: 100;
}
#babylogan{
position: absolute;
z-index: 0;
top: 150px;
left: 225px;
width: 100;
}
#cass {
position: absolute;
z-index: 3;
top: 150px;
left: 225px;
width: 100;
}
#babycass{
position: absolute;
z-index: 2;
top: 150px;
left: 225px;
width: 100;
}
<a href="#" onMouseOver="SwapImg(0, 'babylogan.jpg')"
onMouseOut="SwapImg(0, 'logan.jpg')">
<img border="0" src="logan.jpg" height="300" width="400" alt="Logan" /></a>
<a href="#" onMouseOver="SwapImg(2, 'babycass.jpg')"
onMouseOut="SwapImg(2, 'cass.jpg')">
<img border="0" src="cass.jpg" height="300" width="400" alt="Cassandra" /></a>
Logan's pics work but Cassandra's doesnt. I also have to add one more set of pics for my other daughter.
Thank you again for all your help. The next course I am taking is Javascript so hopefully I will be able to figure this out on my own after I finish it.
Linda:confused: