Welcome to the Treehouse Community
Looking to learn something new?
jQuery- Adding Interactivity- arrow
Hello, Thank you for helping me out in advance- I am working on adding interactivity, front end for ruby on rails and am stuck here: $ (args) - $('.status').hover (event) -> $(this).toggleClass("hover")
The lesson says that the arrow should indent some content, and well, nothing happens on mine and nothing is highlighted either (status, this, hover are on the videos). What am I doing wrong? I imported the bootstrap application.js files, or so I think... Help? Thanks.
Hey Alexandra could be a syntax issue try so it appears exactly as below-
$ -> $('.status').hover (event) -> $(this).toggleClass('hover')
Also, the above is coffeescript, if for any reason you may have removed the .coffee extension on the status.js.coffee file the above will not work. And also as a sanity check make sure you have your classes properly labeled with 'status' in your .html.erb file. jQuery selectors work the same as css selectors so
would not work, if in your status/index.html.erb file you had
<div class="statssssus"> <% @status.each do |status| %> <%= status.content %> <% end %> </div>
because the html class and what jQuery is trying to select don't match. Hope this helps.
It does help indeed! Thank you so much- it's working now:) X.