Click/swipe function to open/close nav bar