/    Sign up×
Community /Pin to ProfileBookmark

Need help with Swap Image

Greetings – first let me give you the scenario I’m dealing with

I’m having trouble with a menu I’ve created in one frame affecting data in another frame.

Presently have 3 images (buttons) stacked atop eachother. I’d like to have “onClick” the image swap for the selected button, and change the content in the main (other) frame. That’s easily done in html … my problem is that when I click another of the menu buttons, the swapped image remains on the first button and adds a swapped image also to the 2nd button – what I need is the 1st button to revert back to its original state, and the swapped image to appear for the second button.

I could use some help with javascript here… how can I make it so that on a click of a different button the first button reverts, and the second button swaps, and so on?

Can anyone please help???

Below is the basic HTML code:

<td>
<a href=”aboutus.htm” TARGET=”main” onClick=”MM_swapImage(‘One’,”,’images/aboutus-B.jpg’,1)”><img src=”images/aboutus-A.jpg” alt=”About Us” name=”One” width=”142″ height=”25″ border=”0″></a><br>
<a href=”courses.htm” TARGET=”main” onClick=”MM_swapImage(‘Two’,”,’images/courses-B.jpg’,1)”><img src=”images/courses-A.jpg” alt=”Courses” name=”Two” width=”142″ height=”23″ border=”0″></a><br>
<a href=”services.htm” TARGET=”main” onClick=”MM_swapImage(‘Three’,”,’images/services-B.jpg’,1)”><img src=”images/services-A.jpg” alt=”Services” name=”Three” width=”142″ height=”25″ border=”0″></a>
</td>

Thank you,

to post a comment
JavaScript

1 Comments(s)

×

Success!

Help @Melissa_N spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...