Solved

How do i piece together my on hover image?

Posted on 2011-02-21
4
180 Views
Last Modified: 2012-05-11
I'm trying to change the color of 3 images (all at the same time) in the hover (o rollover) of <a></a> (an a tag / hyperlink). I'm having trouble with understanding how to "piece" all the images together so that when you roll over one all three "light up". How can I accomplish this?
0
Comment
Question by:mikesExpertExchange
  • 2
4 Comments
 
LVL 30

Expert Comment

by:LZ1
ID: 34946381
Do you have any code you can show us or maybe a live URL?

Also: Are you talking about multiple backgrounds inside the <a> tag? Can you give a more clear example?
0
 
LVL 5

Accepted Solution

by:
wmadrid1 earned 500 total points
ID: 34946809
<img id="img1" src="">
<img id="img2" src="">
<img id="img3" src="">
<a onclick="change();" href="javascript: void();">
<script>
function change()
{
      document.images['img1'].src = "new path of mg1";
      document.images['img2'].src = "new path of mg2";
      document.images['img3'].src = "new path of mg3";
}
</script>
0
 
LVL 5

Assisted Solution

by:wmadrid1
wmadrid1 earned 500 total points
ID: 34946844
<a onrollover="change();" href="javascript: void();">

You can customize it, to pass 3 var with te new path, and call it again in rollout
Also, you can change the background image wit
      document.getElementById(id).style.background = 'url('+imgSrc+')';

0
 
LVL 1

Author Closing Comment

by:mikesExpertExchange
ID: 35133110
thank you
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 50
"Pause" execution of javascript function for x miliseconds 2 28
Downside of adding characters set in ASP pages 6 21
Select case on click 3 16
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question