0

I have two sidebars and left and right and centre box. if both sidebar is slide out using margin-left:"0" and margin-right: "0" then center box become full width.

I wrote jquery if statements and is not working what I"m missing.

$(document).ready(function(){
        if ($(".sidebar-nav").css("marginLeft")=='0px' && (".sidebar-nav-right").css("marginRightt")=='0px') {
        $(".center-box").css("margin-right", "0"); 
        $(".center-box").css("margin-left", "0"); 
    } else {
        $(".center-box").css("background" , "red"); 
    }
}); 

0 Answers0