Re: Help with OnMouseOver

by DScha97041(at)aol.com

 Date:  Thu, 16 Sep 1999 21:24:50 EDT
 To:  nossaune(at)mandic.com.br,
hwg-basics(at)hwg.org
  todo: View Thread, Original

Sorry for sending this twice but I forgot to take out the < > for the 
link. So now you can see the link code.

In a message dated 9/16/99 2:57:19 PM, nossaune(at)mandic.com.br writes:

>1. A table at leftside with the links and a vertical rule;
>2. A bigger space at the centre with a text and another vertical rule;
>3. Another rectangular table at the  rightside, with a gif.
>Here is the problem:  this gif at the rightside must change when user is
>passing over the links at leftside. I want to put there an introduction
>of the subject at each page linked, so I have some little coloured 
>rectangular grafics with the texts inside.


I have just been playing with this vary same thing. Try this and see if it
will work for you. It did work for me.

<SCRIPT language="JavaScript" type="text/javascript">
<!-- hide code
if (document.images)  {
// create array for images. The number in () are the size of image.
                    var imageArray = new Array()
                    imageArray[0] = new Image(50, 70)
                    imageArray[1] = new Image(50, 70)
                    imageArray[2] = new Image(50, 70)

// set URLs for the images
                    imageArray[0].src = "your/image.gif"
                    imageArray[1].src = "your/image.gif"
                    imageArray[2].src = "your/image.gif"
                    
}

// x selects the position in the array and i selects the image to use.
// document.images is the array of images and the one you want to use should 
be counted
// from the top of page.
// imageArray is the array of pictures you have created and you select the 
one to use.
// Remeber that arrays start at position zero.

function imageOn(x, i)  {
        if (document.images)  {
            document.images[x].src = imageArray[i].src
            return true
        }
}


// end hide-->
</SCRIPT>

The above goes in the head and the line bellow goes in the body. the numbers 
to pass to the function mean (this is the array position "4", the image to 
use "1")
use your own for these two numbers. The position in the array is equal to the 
image
number from the top of page.

A HREF="your/link.html" onMouseOver="imageOn(4, 1)"
 onMouseOut="imageOn(4,0)"  Your link /A 

Dick

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA