Closed Thread Icon

Preserved Topic: OnMouseOver that writes into a layer? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18203" title="Pages that link to Preserved Topic: OnMouseOver that writes into a layer? (Page 1 of 1)" rel="nofollow" >Preserved Topic: OnMouseOver that writes into a layer? <span class="small">(Page 1 of 1)</span>\

 
Flik
Bipolar (III) Inmate

From: The Attic
Insane since: Dec 2000

posted posted 07-07-2001 21:10

Hi folks,

I've seen an interesting feature on some sites (I remember the old andyart interface) - changing an image that is stored somewhere else on the page via onmouseover. Does anybody have a clue how to do this?

Thank you says

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 07-07-2001 22:19

This is really the same as any mouseover imageswap. The fact that most happen to the image that you are over is really irrelevant.

If you go through docs mouseover tute, look at the function that does the swap.
it takes 2 variables. Something like this.

swap(0,2);

The first number is the image you want to switch the second is what to switch it with. (I think I haven't looked at the tute lately).

So while usually the first number is the one you are over it doesn't have to be.

And to switch 2 images. you can simply do this
onmouseover="swap(0,2);swap(1,3);"


Walking the Earth like Kane

Flik
Bipolar (III) Inmate

From: The Attic
Insane since: Dec 2000

posted posted 07-08-2001 12:27

Great, thanks a lot

arlechinu
Bipolar (III) Inmate

From: dunno, really dunno anymore...
Insane since: May 2001

posted posted 07-09-2001 13:50

what would it take to make it work with on mouseover over an area ?
and where is doc's mouseover tut?

arlechinu's rustforge...

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 07-09-2001 17:40

See links at bottom, see the one that says hands on. Click on that link. Or click http://www.handson.nu and you will be there.

Dark
Neurotic (0) Inmate
Newly admitted
posted posted 07-15-2001 15:48


Im not sure where you guys are finding Dr's tut at, but here is my code made with a hand text editor.....this works in IE.

<!--Place this script in the HEAD section.-->

<script language="JavaScript">

var n3 = false;
image1 = new Image();
image1.src = "Name of image goes here";
image1on = new Image();
image1on.src = "name of 2nd image goes here"

function on3(name)
{
document[name].src = eval(name + "on.src");
}

function off3(name)
{
document[name].src = eval(name + ".src");
}

n3 = true;
function on(name)
{
if (n3)
on3(name);
}

function off(name)
{
if (n3)
off3(name);
}
</script>
<br>
<br>
<!--Place this script in the BODY section.-->

<!-- Type your URL within the quotation marks below. -->
<a href="put address here" onmouseover="on('image1');" onmouseout="off('image1')">
<!--The image name below should correspond with the first image in the <HEAD> section.-->
<img src="put 1st image here" border="0" name="image1"></a>
<!-- For some reason i have never had to add the 2nd img src but if it
doesnt work for you just add it in, change"image" to "image2". -->
<!-- Rock on guys and keep up the good work-peace out-dark -->






[This message has been edited by Dark (edited 08-02-2001).]

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 07-15-2001 16:05

Doc's tutorial can be found here: http://www.handson.nu/CODING/javascript.shtml

BTW I also wrote a rollover script called "maxMenu" (two states and three states versions) and it could be found here in the Asylum, just perform a search for "maxMenu"...

Dark
Neurotic (0) Inmate
Newly admitted
posted posted 07-15-2001 17:37

lol! my bad max.......sweet code man.






[This message has been edited by Dark (edited 07-28-2001).]

« BackwardsOnwards »

Show Forum Drop Down Menu