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: 1710
Discussions: 188,401, Posts: 2,243,608, Members: 232,631
Old September 20th, 2005, 11:55 AM   Digg it!   #1 (permalink)
Ultimate Member
 
SpaceSquad's Avatar
 
Join Date: Nov 2004
Location: Ottawa, Ontario
Posts: 2,661
Send a message via MSN to SpaceSquad
Mouseover HTML not working correctly

Well i have to make this web-based story dealie in one of my classes, and so we need to add all the bad looking corny stuff to make the grade.

Most people are using Fireworks...but it leaves like 5 lines of javascript and like 10 lines of HTML for each mouseover image...I like to keep my code good looking.

So I found a great piece of code that works great..and doesnt even use Javascript. The only problem is that I can't seem to use this code twice on the same page...and I need to do a home button, Start Story button, etc.

Here is the code:
Code:
<a href="index.html"
        onmouseover="document.NAME.src='home1.gif'"
        onmouseout ="document.NAME.src='home2.gif'">
  <img name=NAME src='orig-picture'>
  </a>
Thanks in advance
__________________
-Space

SpaceSquad is offline   Reply With Quote
Old September 20th, 2005, 12:50 PM     #2 (permalink)
dword to your moms
 
krohnjw's Avatar
 
Join Date: Oct 2001
Location: ~/
Posts: 3,195
Send a message via AIM to krohnjw
You are changing the NAME variable with each entry, no?

krohnjw is offline   Reply With Quote
Old September 20th, 2005, 01:10 PM     #3 (permalink)
Banned
 
Iturea's Avatar
 
Join Date: Jan 2004
Location: Earth
Posts: 420
Smile

Your problem lies with this line:

Code:
<img name=NAME src='orig-picture'>
The src points to nothing.

You need something like this:

Code:
<a href="index.html" onmouseover="document.NAME.src='home1.gif';" onmouseout="document.NAME.src='home2.gif';">
  <img name="NAME" src='home2.gif' alt="image" id="NAME" border="0" />
</a>
by the way, the code within the mouseover and mouseout event is Javascript. :-)

Iturea is offline   Reply With Quote
Old September 20th, 2005, 01:12 PM     #4 (permalink)
Senior Member
 
bwcc's Avatar
 
Join Date: Nov 2001
Location: Central KS
Posts: 830
As what krohnjw said - remember that each time you use that document call, you have to change the name of the doc is it calling:

Code:
Instance #1:
<a href="" onmouseover="document.myimage.src='pic1.jpg'" 
onmouseout="document.myimage.src='pic2.jpg'">
<img name="myimage" src="pic2.jpg"></a>

Instance #2:
<a href="" onmouseover="document.yourimage.src='pic3.jpg'"
 onmouseout="document.yourimage.src='pic4.jpg'">
<img name="yourimage" src="pic4.jpg"></a>
bwcc is offline   Reply With Quote
Old September 20th, 2005, 04:33 PM     #5 (permalink)
Ultimate Member
 
SpaceSquad's Avatar
 
Join Date: Nov 2004
Location: Ottawa, Ontario
Posts: 2,661
Send a message via MSN to SpaceSquad
kay..thanks...i feel dumb...

What I meant by haveing "no javascript" is that I don't need to put seperate Javascript code in my head tag...this way I get a less bloated code.
SpaceSquad 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FAD] Is this working correctly? fourthbean Distributed Computing 3 December 10th, 2004 07:41 PM
mouseover ClubMed Webmastering and Programming 4 May 17th, 2004 05:07 AM
Video Card not working correctly PrinceOllie Technical Support 8 December 7th, 2002 11:26 PM
PHP Not working for .html file vass0922 Webmastering and Programming 7 November 10th, 2002 04:16 AM
Threads grey on mouseover? jkrohn IMO Community 12 May 7th, 2002 12:20 PM

Most Active Discussions
Is It Just Me? (2906)
3-days in and no threads about Gaza (161)
Unarmed man on his stomach shot by .. (6)
New Build ( Finally ) (7)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
RCA 52Inch HDTV wont turn on (5)
Folderchat Weekday thread (444)
Recent Discussions
Laptop proccesor to desktop mob.. (2)
Please help! multiple problems! (4)
RCA 52Inch HDTV wont turn on (5)
New Build ( Finally ) (7)
Common Spyware Solutions (97)
How do you move a hard-drive to.. (4)
What is the best external enclo.. (0)
Partition Magic 7.0 (Unallocate.. (17)
For cheap price and good qualit.. (1)
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 04:12 AM.
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