Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Basic Image Swap Question...
Old 03-16-2008, 03:15 AM Basic Image Swap Question...
Skilled Talker

Posts: 70
Location: Atlanta, GA
Trades: 0
Hello everyone.

I'm completely new to JS. I'm just learning the basics.

I'm doing a problem in a book that wants me to mouse over one image and change two other images while mousing over that one image. My code doesn't seem to be working...Any idea of how to do this?

Code:
<html> <head> <style type="text/css">
a {border: none;}
* {border:0; padding:0; margin:0;}
#container {position:relative; width: 1000px; height: 600px; margin: 0 auto 0 auto; border: 1px solid black;}
#img1 {position:absolute; left: 100px; top: 100px;} #img2 {position:absolute; left: 300px; top: 100px;} #img3 {position:absolute; left: 450px; top: 100px;}
</style></head> <body>
<div id="container">
<div id="img1"> <img src="C:\wamp\www2\JRStudios2\images\Link-Bkgd5.png"
onMouseOver="my_image1.src='C:\wamp\www2\JRStudios2\images\Link-Bkgd2.png';" "my_image2.src='C:\wamp\www2\JRStudios2\images\Link-Bkgd1.png';"
onMouseOut="my_image1.src='C:\wamp\www2\JRStudios2\images\Link-Bkgd1.png';" "my_image2.src='C:\wamp\www2\JRStudios2\images\Link-Bkgd2.png';" alt=""> </div>
<div id="img2"> <img src="C:\wamp\www2\JRStudios2\images\Link-Bkgd1.png" name="my_image1" alt=""> </div>
<div id="img3"> <img src="C:\wamp\www2\JRStudios2\images\Link-Bkgd2.png" name="my_image2" alt=""> </div>
</div> </body> </html>
LayneMitch is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-16-2008, 03:38 AM Re: Basic Image Swap Question...
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
I don't know whether this is it or not, but try putting the mouse event code in functions instead of inline. I'm not sure whether you can put more than one statement inside an inline event handler like that?

On another note, make onmouseover and -out all lower case, if you'd like your code to validate.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to Basic Image Swap Question...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10236 seconds with 12 queries