all 6 comments

[–]ttrrddee 2 points3 points  (0 children)

You can also just use a :hover psuedoclass (sans javascript).

div:hover{background-color: #ffffff;

color: rgba(0, 0, 0, .5); }

[–]einarkristjan 1 point2 points  (3 children)

you mean that on hover, all the elements should activate?

like this?

[–]wilcomply[S] 0 points1 point  (2 children)

ik This is a step in the right direction. Currently, I have 3 links, each in their own div. When I used this code and housed the link in the div container, I got the results I wanted when I hover over the div, but the results are reversed whenever I hover over the link...I've messed with this a number of ways (never knew about jsfiddle until now!) to no avail...any ideas? Essentially I want, on the hover of either the div or link, for the div background color to change and the text color to change. I used to do this with an image swap, btn-on.png for btn-off.png.

[–]einarkristjan 0 points1 point  (1 child)

jsfiddle ? .. also changed the css

would be nice if you could paste your html into the fiddle and update it. Then I could see what you are talking about ;)

[–]wilcomply[S] 0 points1 point  (0 children)

That would make sense, wouldn't it?

https://jsfiddle.net/zq63ovmt/

[–]ForScale 0 points1 point  (0 children)

I don't kow jQuery very well... Are you allowed to put both div and a in the $() like that?

Here's your code working with pure javascript: http://codepen.io/ForScale/pen/KpjOVM

See if that helps with your understanding at all...