Check whether the navigation pane is visible
When scripting WebHelp output to make it behave the way you want, you may have to check whether the navigation pane is visible. Her’s a small script that does just that!
The function returns true
when the navigation pane is visible. The function returns false
when the navigation pane is hidden or when the skin is not shown at all.
Use the function as follows:
if(isnavpanevisible()) { //Do something if the navigation pane is visible }
And here’s the code. Add it to a topic or anywhere else in your output:
function isnavpanevisible() {//Is navigation pane visible? function GetTopicPane() {//Get the topic pane var topicPane; if (top.frames[0].name == "ContentFrame") { topicPane = top.frames[0].frames[1].frames[1]; } else { topicPane = top.frames[1].frames[1]; } topicPane.focus(); return topicPane; } if(isTopicOnly()) { return false; } var topicPane = GetTopicPane(); if(gbIE) { /* This method is for IE. IE doesn't correctly support clientWidth: it will allways return the body width even if a frame has a width of 0. Now we get the width of the frameset in the properties of the frameset. Note that this method only works for LTR help. If you use RTL help, you need to amend the colsetting compare to "*,0". */ if(topicPane.parent.document.getElementsByTagName("FRAMESET")[0].getAttribute) { var colsetting = topicPane.parent.document.getElementsByTagName("FRAMESET")[0].getAttribute("cols"); } else { var colsetting = topicPane.parent.document.getElementsByTagName("FRAMESET")[0].cols; } if(colsetting == "0,*") navpanewidth = 0; else navpanewidth = 1; } else { var navpanewidth = topicPane.parent.frames[0].document.body.clientWidth; } if(navpanewidth == 0) { return false; } else { return true; } }