Number 4, Toggle the notification bell to yellow


#1


https://www.codecademy.com/courses/jquery-ext/projects/jquery-prj_gameboard


I got the More toggle, and Share toggle working. I have tried a lot of combinations to get the notification bell to turn yellow. The css file has a .notification.active section that is yellow, but I am not sure that is the correct "active" class that I am supposed to toggle. Or I am not getting the syntax correct in the handler and event.

Thanks for the help.


var main = function() {
$('.more-btn').click(function() {
  $(this).next().toggle('more-menu');
});
  $('.share').click(function() {
  $(this).next().toggle('share-menu');  
  });
  
 $('.bell').click(function() {
   $(this).next().toggleClass('active');
 });
};

$(document).ready(main);


#2

Since you are traversing no need to specify a selector.

$(this).next().slideToggle();

Likewise above.

$(this).next().slideToggle();

If you select .notification,

$(this).toggleClass('active');

#3

Thanks again. For the bell problem and the simplified way on the other two toggles. lol at least I'm getting more done before I have to go looking for help.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.