Replaces JS for navigation with jQuery function
Changed click event to document