JavaScript Cases: Sliding Menu

Menu Expand/Collapse Menu

For tiny monitors, I wanted to allow the user to slide the menu/TOC off to the left so that the whole screen could be used for viewing the right panel content. This is implemented by calling a java script function using an anchor tag, see yellow highlight. The java script: (1) sets an object reference for each element that needs to move left/right on a toggle, (2) determines the open/close status of the menu, then (3) moves the elements. This java script is adapted from Visual Quickstart Guide CSS, DHTML, and Ajax, Fourth Edition by Jason Cranford Teague.

Code provided in screenshot for study only, hence no copy/paste.

JScript Cases