Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript

Simple jQuery question!

Alright, I'm trying to use some jQuery code to have 1 of the hover states on this nav list already selected before a click is made. Then when a click on the next hexagon is made it will remove the current selection and insert the new selection.

I have everything working on a jsfiddle however the jsFiddle I got it working on is without the code being on a hoverstate.

Here is the effect I am trying to use - http://jsfiddle.net/7nVaD/4/

Here is the project I am working on that I can't get the code I wrote to work on http://jsfiddle.net/PjK84/69/

All help is appreciated. I don't think this is a very hard question I think I am just having tunnel vision and it hasn't clicked yet

Cheers!

EDIT: I was able to get it working on my own. You guys can view the jsfiddle at http://jsfiddle.net/PjK84/70/

I'm not sure if this is the best way to go about doing this. As I was hoping to have it replace the selected content with the content of the hovered element. Right now it only changes on click, I'm trying to figure out how to make it change when it's hovered on other elements then a click will bind it.

Help is greatly appreciated!

1 Answer

Why note use jQuery mouseover()?

http://api.jquery.com/mouseover/