The following sections of the Mif2Go User's Guide present examples of macros that incorporate JavaScript to dynamically expand and collapse areas of text:
§7.9.7 Deploying JavaScript code for drop-down sections
§7.9.8 Emulating Web Works Publisher drop-down hotspots
You can modify these macros for your own purposes.