Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMichael Navarro
946 PointsIsn'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
Adam Sackfield
Courses Plus Student 19,663 PointsYes 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.
Scott Harris
9,147 PointsYes. Definitely watch the sass lessons, once set up you can do:
.status .admin {
display: none;
&:hover{
display: inline;
}
}
Adam Sackfield
Courses Plus Student 19,663 PointsTotally 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
Michael Navarro
946 Pointsgood to know. thanks :)
Michael Navarro
946 PointsMichael Navarro
946 Pointsyeah thanks. That's what i thought :)
Adam Sackfield
Courses Plus Student 19,663 PointsAdam Sackfield
Courses Plus Student 19,663 PointsNo problem!