• Resolved wpdevboy

    (@wpdevboy)


    The sidebar menu on the front page opens and closes fine when you click the cog but not after you click (touch) a link on mobile – it stays open.

    Is there some reason why its not auto closing after you click a link? Ive tried adding a click function to force it to close but its not working.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter wpdevboy

    (@wpdevboy)

    All good fixed it, adding this to the footer

    <script>
    jQuery(document).ready(function() {
      jQuery('.home_page_sidebar_menu li').click(function() {
        if(jQuery(window).width() < 1000){
    	jQuery(this).parents(".sidebar").addClass("hide-sidebar");	
    	jQuery('#panel-cog i').removeClass('fa-chevron-left').addClass('fa-chevron-right');
    	jQuery('section.content_wrap').css({'margin-left':'0px'});
    	}
      });
    });
    </script>
    Thread Starter wpdevboy

    (@wpdevboy)

    Hopefully its obvious but if youre using this code just edit the pixel width you want to add the click to close option (mines set to 1000px)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sidebar not closing on mobile’ is closed to new replies.