Oops, try again. Add the line $(document).ready(main)


#1



i alread add the line $(document).ready(main); it shows error i can't submit


var main = function(){
    
    $('.icon-menu').click(function(){
        $('.menu').animate({left:"0px" },200);
        
        $('body').animate({left: "285px"},200);
        
        });
    
        $('.icon-close').click(function(){
        $('.menu').animate({left: "-285px" },200);
        
        $('body').animate({left: "0px"},200);
        
        });    
    };
    $(document).ready(main);



#2

$('.menu').animate({left:"-285" },200);

It should be -285px


#3

i edited the code but no change

var main = function(){
    
    $('.icon-menu').click(function(){
        $('.menu').animate({left:"0px" },200);
        
        $('body').animate({left: "285px"},200);
        
        });
    
        $('.icon-close').click(function(){
        $('.menu').animate({left:"-285px" },200);
        
        $('body').animate({left: "0px"},200);
        
        });    
    };
    $(document).ready(main);

#4

did you try after refreshing your browser?


#5

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