Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need code for multiple rollovers PLEASE! (newbie!)

Status
Not open for further replies.

paul1210

Technical User
May 10, 2002
9
GB
HI - I need to make an image rollover where two other images change at the time of the mouseover. (So when the pointer enters an image, another 2 images change)

Sorry if this sounds vague - any ideas, clues and examples would be much appreciated!

Paul
 
Hi Paul,

Here is an example of what I think you are looking for. It displays three boxes: red, green and blue. When you move your mouse pointer over one of the boxes, the other two turn pink. When the mouse pointer moves out of the box they revert back to their original colours. Heres the code:

Code:
<html>
<title>Image RollOver Example</title>
<body bgcolor=&quot;#FFFFFF&quot;>
<center>

<p>

<a href=&quot;red.htm&quot; 
onmouseover='greenbox.src = &quot;pink.jpg&quot;;bluebox.src = &quot;pink.jpg&quot;' 
onmouseout='greenbox.src=&quot;green.jpg&quot;;bluebox.src = &quot;blue.jpg&quot;'>
<img name=&quot;redbox&quot; src=&quot;red.jpg&quot; border=0 width=25 height=25 alt=&quot;Red&quot;></a>
 

<a href=&quot;green.htm&quot; 
onmouseover='redbox.src = &quot;pink.jpg&quot;;bluebox.src = &quot;pink.jpg&quot;' 
onmouseout='redbox.src=&quot;red.jpg&quot;;bluebox.src = &quot;blue.jpg&quot;'>
<img name=&quot;greenbox&quot; src=&quot;green.jpg&quot; border=0 width=25 height=25 alt=&quot;Green&quot;></a>
 

<a href=&quot;blue.htm&quot; 
onmouseover='redbox.src = &quot;pink.jpg&quot;;greenbox.src = &quot;pink.jpg&quot;' 
onmouseout='redbox.src=&quot;red.jpg&quot;;greenbox.src = &quot;green.jpg&quot;'>
<img name=&quot;bluebox&quot; src=&quot;blue.jpg&quot; border=0 width=25 height=25 alt=&quot;Blue&quot;></a>
 

</center>

</body>
</html>

HTH[smile] mikey2nicey
&quot;Dream, but don't quit your day job.&quot;
 
To make life easier, if you're using dreamweaver, the software has a function in there that allows you to have multile roll-over images...and it does the coding for you as well, so you do not have to worry about browser compatibility... I have not failed; I merely found 100,000 different ways of not succeding...
 
Wow, cheers! I've got it sorted now. Thanks loads of your help guys!

Have a good weekend,

Paul
 
Hi Paul.

Good to see that its sorted now. I'm not fishing for stars but the protocol on this site is if a post has been helpful or informative then you should give it a star by marking it as helpful. It also helps others see where helpful posts have been made.

Regards [thumbsup2]
mikey2nicey
&quot;Dream, but don't quit your day job.&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top