Skip to main content
added 170 characters in body
Source Link
No Sssweat
  • 31.6k
  • 14
  • 55
  • 91

tryIf statement in jQuery example:

if (n < 2) {
        $("body").css("background", "green");
    } 

I noticed your if statement is missing curly brackets { } so try

(function ($) {
    
  $(document).ready(function() {
     $("#second-column").on("swipe",function(){
           if($(window).width()<=900) {
           $("#nice-menu-1>li>ul").css("display: block; visibility: visible;"); 
           }           
        });
    });
        
})(jQuery);

try

(function ($) {
    
  $(document).ready(function() {
     $("#second-column").on("swipe",function(){
           if($(window).width()<=900)
           $("#nice-menu-1>li>ul").css("display: block; visibility: visible;");
        });
    });
        
})(jQuery);

If statement in jQuery example:

if (n < 2) {
        $("body").css("background", "green");
    } 

I noticed your if statement is missing curly brackets { } so try

(function ($) {
    
  $(document).ready(function() {
     $("#second-column").on("swipe",function(){
           if($(window).width()<=900) {
           $("#nice-menu-1>li>ul").css("display: block; visibility: visible;"); 
           }           
        });
    });
        
})(jQuery);
Source Link
No Sssweat
  • 31.6k
  • 14
  • 55
  • 91

try

(function ($) {
    
  $(document).ready(function() {
     $("#second-column").on("swipe",function(){
           if($(window).width()<=900)
           $("#nice-menu-1>li>ul").css("display: block; visibility: visible;");
        });
    });
        
})(jQuery);