Click to See Complete Forum and Search --> : how can i swap images and change the second image position


Samy16
September 29th, 2002, 07:14 AM
i want to swap 2 images and to change the swapped img position so when i put the mouse over some text it will make the first image desapear and shw the second image bellow the text by getting the x and y coordinates of the text
can any one help

Waldo2k2
September 29th, 2002, 10:17 PM
woh woh woh, hold 'er down there killer, there's a much easier way to do this than getting the x and y coordinates of the text.
And what you're doing sounds to me like it's not really an image swap in the normal sense. I think that this would be much easier.

<!--in the head-->
<style type="text/css">
#img1{position:absolute; top:0px;left:0px;visibility:"visible"}
#text1{position:absolute;top:210px;left:0px;visibility:"visible"}
#img2{position:absolute;top:240px;left:0px;visibility:"hidden"}
</style>


<!--in the body-->
<img id="img1" src="image1.jpg" height="200px" width="50px">
<div id="text1"height="20px" onmouseover="javascript:document.all.img1.style.visibility='hidden';document.all.img2.style.visibility='visible';" onmouseout="javascript:document.all.img1.style.visibilty='visible';document.all.img2.style.visibility='hidden';">
Some Text Here
</div>
<img id="img2" src="image2.jpg" height="200px" width="50px">

there you go
much simpler, and you can adjust the positions anyway that you want to. good luck.