HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 18th, 2000, 12:00 AM
tigertim tigertim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 1999
Location: St.JOhn's, Newfoundland, Canada
Posts: 7 tigertim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I need a script that when you run the mouse over a text or image link, and it displays an image in another table cell.

The images that I need to use are

Before mouseOver

medstudents.gif image to display in other cell when mouseover occurs is medstudent_desc.gif

medresidents.gif image to display in other cell when mouseover occurs is medresidents_desc.gif

pracphyis.gif image to display in other cell when mouseover occurs is pracphyis_desc

imm.gif image to display in other cell when mouseover occurs is imm_desc

job.gif image to display in other cell when mouseover occurs is job_desc

Can someone please give me the script with these images inserted.

Thanks
Tim


Reply With Quote
  #2  
Old February 20th, 2000, 12:22 AM
Spookster Spookster is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Posts: 84 Spookster User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
<HTML>
<HEAD>
<TITLE>Simple Image Rollover</TITLE>
<SCRIPT LANGUAGE=JAVASCRIPT>
<!--//
/* Author: Spookster
* Email: ts_spook@hotmail.com
* Description: This script will preload your images and allow you to
* produce a dynamic rollover effect.
*/

// This statement detects if the browser supports the image object
if (document.images) {

//This section instantiates or creates the image objects
//You can also add the width and height of the images inside the parentheses seperated by a comma
image1 = new Image();
image2 = new Image();

//This section specifies the location or url of the images to be used
image1.src = "image1.jpg"
image2.src = "image2.jpg"
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<!-- To produce the rollover effect you will use the onMouseove/onMouseout event
handlers. You must give your image tag an id. To do that you will just add the
name attribute(ie. <img name="myimage"> ) inside of the image tag. Then
refer to the image you would use "document" which refers to the page that the
image tag resides in followed by a period and the you type the name you gave
to the image with the name attribute and then another period and type "src=".
The src is what you assigned to the location of the image to be changed back
in the script(ie. image1.src). If you wanted to change an image located in
another frame then the statement in your onMouse event handler would look
something like this:
onMouseover="parent.framename.document.rollover.src=image2.src"
You will just need to add a path to the other image. In this case you refer to the
parent window and the the framename and then continue the statement as usual.
One final note- In the HREF if you want an actual link to another page then just
put the link in there. If you do not want to link to another page then you can
just use the following to disable the HREF portion: HREF="javascript:void(null);"
-->
<A HREF="somewhere.html" onMouseover="document.rollover.src=image2.src" onMouseout="document.rollover.src=image1.src">
<IMG SRC="image1.jpg" border="0" name="rollover"></A>
</BODY>
</HTML>

Spookster

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Help with image switcher


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway