Sorry Shanj.
Because XF utilises jQuery it allows us to create effects such as this without much problem. jQuery has a function named
slideUp which can be used here to hide the categories. If you assign this slideUp function to an icon in the category menus then you can hide the menus. From here you need to store the state of the categories either in the database or in a cookie.