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.

Ruby Build a Simple Ruby on Rails Application Frontend Development Adding Interactivity

Isn't there an easier way to toggle hover state?

Cant we just use this:

.status .admin { display: none; }

.status:hover .admin { display: inline; }

this would require no javascript or coffeescript. Just css.

2 Answers

Yes this is the way I did it. It's done the JS route due to the video being created prior to the :hover pseudo classes being available. So your route is correct.

yeah thanks. That's what i thought :)

No problem!

Yes. Definitely watch the sass lessons, once set up you can do:

.status .admin { 
    display: none; 
    &:hover{
        display: inline;
    }
}

Totally right, but I think the OP was referring to the unnecessary use of JS in the videos, rather than the use of the CSS/SCSS

good to know. thanks :)