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:
- $(document).ready(function(){
- if(screen.width <=657){
- $('.secondary-navigation-hide').hide();
- $('#countries-dd').click(function(){
- $(this).toggleClass('hl');
- $(this).next().toggle(1);
- });
-
- $('.primary-navigation-hide').hide();
- $('#categories-dd').click(function(){
- $(this).toggleClass('hl');
- $(this).next().toggle(1);
- });
- }
- });