home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2804
Discussions: 188,384, Posts: 2,243,508, Members: 232,615
Old February 16th, 2003, 07:30 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Jan 2003
Posts: 42
use same function twice?

Howdy all

I am constructing a situation wherein mouseover of link image instigates appearance of a descriptive text image elsewhere.
<!------------------------------------------------------------------>
<SCRIPT LANGUAGE="JAVASCRIPT">
function image_over(image_name)
{
image_name.src = "Images/Desc - website.jpg"
}

function image_out(image_name)
{
image_name.src = "Images/BG-Fade3.jpg"
}
</SCRIPT>

<img name="NoText" src="Images/BG-Fade3.jpg">

<A ONMOUSEOVER="image_over(NoText)" onmouseout="image_out(NoText)"><IMG SRC="Images/website link.gif" BORDER=0></A>
<!------------------------------------------------------------------>
This code works fine with one link, but when mouseover occurs on the graphics link (in this example) I need the image "Desc - graphics.jpg" rather than "Desc - website.jpg" to appear (in the same spot).

<A ONMOUSEOVER="image_over(NoText)" onmouseout="image_out(NoText)"><IMG SRC="Images/graphics link.gif" BORDER=0></A>

Is there a way to dfferentiate between multiple instances of the same function?, ie. when the second link is hovered the "Desc - website.jpg" image is shown again, so can I write a second set of functions with some sort of unique identification specifically for each link?

This will be a big help.

Cheers - Nathan

Nathan323 is offline   Reply With Quote
Old February 27th, 2003, 09:24 AM     #2 (permalink)
Junior Member
 
Join Date: Feb 2003
Location: O'Fallon, MO
Posts: 2
Send a message via AIM to blandboringplain Send a message via Yahoo to blandboringplain
Talking

Ok, I tried your code. I found out that if you take your first set, and name them "image_over1" and "image_out1", that it worked just fine (make sure to call on them with the 1's in your code later). You can then make the next set, obviously, "image_over2" and "image_out2". Same thing applies with calling on it later. It worked fine for me this way.

blandboringplain is offline   Reply With Quote
Old February 27th, 2003, 04:13 PM     #3 (permalink)
Ultimate Member
 
strangerstill's Avatar
 
Join Date: Oct 2001
Posts: 1,542
Make it a function with 2 arguments.

strangerstill is offline   Reply With Quote
Old February 28th, 2003, 08:06 PM     #4 (permalink)
Member
 
Join Date: Jan 2003
Posts: 42
Thanks, that got it

Thanks for your help blandboringplain, that fixed it

Nathan
Nathan323 is offline   Reply With Quote
Old March 4th, 2003, 06:40 AM     #5 (permalink)
Junior Member
 
Join Date: Feb 2003
Location: O'Fallon, MO
Posts: 2
Send a message via AIM to blandboringplain Send a message via Yahoo to blandboringplain
No problem, glad I could do something.
blandboringplain is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may 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
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Most Active Discussions
Is It Just Me? (2896)
CPU wont boot (6)
3-days in and no threads about Gaza (160)
The United States Debt (20)
I think I just killed my computer w.. (24)
hp compaq nc6000 problems (139)
Upgrading RAM (5)
Folderchat Weekday thread (442)
Antec 300 bulk purchase? (11)
Recent Discussions
CPU wont boot (6)
GLaDOS is up. (3)
HP notebook reinstall Vista NO .. (5)
Building a gaming computer advi.. (4)
hp compaq nc6000 problems (139)
Folderchat Weekday thread (442)
Creative T-3000 Subwoofer (3)
ACPI controller halt on boot (2)
Worth the upgrade?? (15)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 10:37 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28