problem with screen.width

problem with screen.width

Hi,

I'm very new to jQuery but I have had to learn a little to make a responsive website.

my problem is with the horizontal navigation menu. I want it to become a drop-down menu when the screen size is less than or = 657px. The problem is that some of the code is working (the .hide) while the rest isn't
i.e the button i click to get the drop down menu to drop. I'm pretty sure I have made a really silly amateur mistake but I can't seem to figure it out. Thanks for your help.


here is the code I'm using:

  1. $(document).ready(function(){
  2.     if(screen.width <=657){
  3. $('.secondary-navigation-hide').hide();
  4. $('#countries-dd').click(function(){
  5. $(this).toggleClass('hl');
  6. $(this).next().toggle(1);
  7. });
  8. $('.primary-navigation-hide').hide();
  9. $('#categories-dd').click(function(){
  10. $(this).toggleClass('hl');
  11. $(this).next().toggle(1);
  12. });
  13. }
  14. });
  15.