Skip to main content
May 30, 2009
Question

Showing and hiding the TOC using JavaScript

  • May 30, 2009
  • 1 reply
  • 1345 views

Hello,

Is there a way to show or hide the WebHelp Table of Contents (TOC) at run-time using JavaScript? Also, can the TOC be hidden by default when viewing WebHelp content?

This topic has been closed for replies.

1 reply

Peter Grainge
Community Expert
Community Expert
May 30, 2009

The user can hide it by clicking the X and show it again by clicking the Contents button.


Is that not what you want?

You can open any topic without the navigation pane by opening it direct rather than using the start page. Double click any topic in Windows Explorer and you will see what I mean. Unless you have turned off the option, there will be a Show link at the top of the page and that will then display the navigation pane.


See www.grainge.org for RoboHelp and Authoring tips

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.
May 30, 2009

Thanks, Peter.

Although the UI buttons are capable of showing or hiding the TOC, I was wondering whether this could be done programmatically with JavaScript. I believe I found the answer to my own question. In the whtopic.js file, there's a function named showHidePane(bShow) that hides the TOC if bShow is false and shows it if bShow is true.

I need such a function to automatically hide the TOC when WebHelp is launched, while preserving the menu bar. When a topic is launched directly, the menu bar is not shown, unfortunately. I wish there was a checkbox in the WebHelp Navigation screen that said something like Show Navigation Pane on Startup.

Peter Grainge
Community Expert
Community Expert
May 30, 2009

I believe that can be done through the CSH API but that's developer territory.

The API is described in the help plus there are some links on my site.


See www.grainge.org for RoboHelp and Authoring tips

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.