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 trial

Ruby

statuses.js.coffeescript code not hovering

hi my status.js.coffeecripts code doesnt run, i dont know why , heres the code

jQuery ->
    jQuery('.statuses').hover (event) ->
         jQuery(this).toggleClass("hover")


am trying to be able to make my statuses hover, below is my statuses.css.scss code

```.status {
    border-bottom: solid 1px #CCC;
    padding: 5px 0;
}

.status p {
margin: 4px 0;

}

.status.hover {
    background-color: red;
}

.status .admin {
    display: inline;
}

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

pls check it out,thanks ```'''

2 Answers

Here is what I have. I see you are all missing "display: none;" under .status .admin

   .status {
    border-bottom: solid 1px #CCC;
    padding: 5px 0;
   }
   .status p {
     margin:  4px 0;
   }
   .status.hover {
    background: #FAFAFA;
   }
   .status .admin {
    display: none;
   }
   .status.hover .admin {
    display: inline;
   }   

Also make sure that you have the code below in the statuses.js.coffee under apps > assets > javascripts If this is not in there, it will not take the code above.

$ -> 
    $('.status').hover (event) ->  
        $(this).toggleClass("hover")

thanks, it works, i appreciate