views:

26

answers:

1

I am trying to change the content inside a DIV from separate links when mouseover. The content is different with each link. I wanted the default content in the DIV to appear with mouseleave. I'm having trouble to figure this out with jquery. Can anyone point me in the right direction or have an example to help.

I figured out how to make the content change with mouseover, but I need help to return the original content with mouseleave.

Many thanks.

Here is my code:

<div id="CONTENT">My content needs to change here.</div>

<div id="nc_wrap2">

<a class="nc1" href="#">Link 1</a>
<a class="nc2" href="#">Link 2</a>
<a class="nc3" href="#">Link 3</a>
<a class="nc4" href="#">Link 4</a>
<a class="nc5" href="#">Link 5</a>



</div>  
A: 

Basic example using your html:

http://jsfiddle.net/XMXct/

---- edit based on comments ----

Try a switch statement: http://jsfiddle.net/rtE2a/1/

hookedonwinter
How would you make the content unique with each link? I didn't want the name of the link, but something different. My links are actually images.
Erik
@Erik See updated answer
hookedonwinter
I don;t understand why its not working when I paste it in the HTML doc:
Erik
What is the behavior you're experiencing? And what are you pasting? If you're copying the jsfiddle code, you also need to include jquery, and a doc ready
hookedonwinter
Doesn't make sense to me... I used the code as instructed but nothing works: http://www.feedmyorphan.com/
Erik
Bottom of the page with the image links
Erik
I did paste as you said, but no good..
Erik
@Erik, it appears to be working. Do you still need help?
hookedonwinter