JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

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 6th, 2013, 07:28 PM
elder76 elder76 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 elder76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 5 sec
Reputation Power: 0
New Member - Mouseover problem

The following "up" and "down" arrows work in an html document. Initially they show as a blue arrow and change to green on mouseover.

This first code has the arrow pointing "down" and the arrow changes to green on mouseover.

<a onmouseover="SwitchImg('document.arrow','document.arrow','images/greenarrow.gif')" onmouseout="RestoreImg()" href="#bottom"><img border="0" name="arrow" alt="Click" src="images/bluearrow.gif" width="23" height="32">

This code has the arrow pointing up, it works but the image does not change color on mouseover. I've double checked the spelling of all the gifs.

<a onmouseover="SwitchImg('document.arrow','document.arrow','images/greenarrowup.gif')" onmouseout="RestoreImg()" href="#top"><img border="0" name="arrow" alt="Click" src="images/bluearrowup.gif" width="23" height="32"></a>

Thank you, any help would be appreciated.

Reply With Quote
  #2  
Old February 7th, 2013, 01:02 AM
web_loone08's Avatar
web_loone08 web_loone08 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 605 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 16 h 30 m 44 sec
Reputation Power: 69
Quote:
Originally Posted by elder76
This code has the arrow pointing up, it works but the image does not change color on mouseover. I've double checked the spelling of all the gifs.


Right off hand, without even looking @ your function(s)... the problem I see... is that you have both the images named "arrow". You need to name each image with a unique name and not name them, with the identically same name. This means you also need to change the parameter of your function for the image element's onmouseover and onmouseout event(s), as well.

Last edited by web_loone08 : February 7th, 2013 at 01:05 AM.

Reply With Quote
  #3  
Old February 7th, 2013, 10:44 PM
elder76 elder76 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 elder76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 5 sec
Reputation Power: 0
Quote:
Originally Posted by web_loone08
Right off hand, without even looking @ your function(s)... the problem I see... is that you have both the images named "arrow". You need to name each image with a unique name and not name them, with the identically same name. This means you also need to change the parameter of your function for the image element's onmouseover and onmouseout event(s), as well.


Thank you for your reply. I gave up on the code that I sent and turned to CSS at the advice of another coder. It was a much more elegant a solution and worked fine.
Comments on this post
web_loone08 agrees: Yeah, CSS is the best and most modernist approach for what your wanting to do.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > New Member - Mouseover problem

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap