Click to See Complete Forum and Search --> : Image rollovers w/ multiple images


robsta117
07-14-2003, 08:56 PM
Hi-

I downloaded a multiple-image rollover script from Javascript Source and modified it to work with a layout I'm designing.

The script enables me to mouseover an image, so that a rollover occurs elsewhere on the page. The "mouse-dover" images don't change.

Q: How can I modify the script below so that the "moused-over" images perform a rollover, in addition to handling the rollover event in the other location?

Please feel free to visit the page I'm working on at: MultipleImageSwop (http://www.fond-regards.com/MultipleImgSwop3.html)

(The images that need the rollover event are the one's in the left-side column).

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var img1a = new Image();
var img1 = new Image();
var img2a = new Image();
var img2 = new Image();
var img3a = new Image();
var img3 = new Image();

img1a.src = "imgs/text1.jpg";
img1.src = "img/image1.jpg";
img2a.src = "imgs/text2.jpg";
img2.src = "imgs/image2.jpg";
img3a.src = "imgs/text3.jpg";
img3.src = "imgs/image3.jpg";

function doButtons(picimage) {
document['picture'].src=picimage;
}
// End -->
</script>

Any and all suggestions will be greatly appreciated -

Robsta

MadCommando
07-15-2003, 12:41 AM
couldn't the <img> tag have an onMouseOver="changepic()" in it? If not I guess you would be stuck having some sort of special code referring to the coordinates of the image and then it would be able to handle onMouseOver events..... but I'm not quite sure.

robsta117
07-15-2003, 10:22 AM
I'll play around with your suggestion and see if I can get it to run.

Any ideas how to write the code? I tend to go at it until it works... any kind of help would be much appreciated.

Thanks -
Robsta

MadCommando
07-15-2003, 10:50 AM
These links might help you out.

http://htmlgoodies.earthweb.com/tutors/imageflip.html
http://htmlgoodies.earthweb.com/beyond/slideshow.html

robsta117
07-15-2003, 11:59 AM
HTML Goodies is where I first learned HTML. A great resource. Thanks for the links - I'll check em out.

- Robsta

robsta117
07-15-2003, 03:05 PM
MadCommando -

Thanks again for your suggestion. I'm not using the image rollover in conjunction with a <a href> tag.

Your suggestion worked with a <div> tag:

<div id="pic1" onmouseover="movepic('image1','imgs/text1b.jpg')" onmouseout="movepic('image1','imgs/text1.jpg')"><img name="image1" src="imgs/text1.jpg" height="149" width="222" border="0" onmouseover ="doButtons('imgs/image1.jpg')" onmouseout ="doButtons('imgs/main.jpg')"></div>

- Much thanks for the help.

Robsta