Skip to main content
LaKisha1
Inspiring
April 26, 2007
Answered

Make Close Window Link Work in WebHelp

  • April 26, 2007
  • 4 replies
  • 760 views
Attached is code that RoboHelp uses to display a Close button in HTML Help, and also some code that I'm trying to use to display a Close Window link in WebHelp. Can this code be modified and used in WebHelp, or is there some other 'Close Window' code that can be used in WebHelp?

The "Close Window" must be a blue link and not a button.

This topic has been closed for replies.
Correct answer LaKisha1
Thanks - it definitely works! Thanks to a developer though, I found out that "%20" is just a space, so that part of the code wasn't needed. In case anyone else needs this solution in the future, I've included the 'before' and 'after' below.

4 replies

LaKisha1
LaKisha1Author
Inspiring
May 3, 2007
Thanks ChrisRousset. I'll try this and mark your reply as the answer after I confirm that it works for the code I'm currently using. :)
LaKisha1
LaKisha1AuthorCorrect answer
Inspiring
May 3, 2007
Thanks - it definitely works! Thanks to a developer though, I found out that "%20" is just a space, so that part of the code wasn't needed. In case anyone else needs this solution in the future, I've included the 'before' and 'after' below.
Inspiring
May 3, 2007
LaKisha,
Just add the following javascript on your close button:
javascript:%20top.close();
This will close the containing frames that the page is in.
Chris
Inspiring
April 27, 2007
Hello LaKisha -

Correct about "close" script in the content frame.

In the RH app, do a search on "Show / Hide". Look at and play with the "Hide" scripting - it displays only the content frame (nav and tools not displayed). Write that type of script for the start of your "close" function, then add the window close scripting available all around the Web. That is, your script starts by hiding all but the topic content then runs the window close portion of the script.

I don't remember the RH file name(s). Idea: make a one topic project and enable the Show / Hide function during project gen. Then look at the output files/code.

Regards,
GEWB
Inspiring
April 26, 2007
Hello LaKisha -

A Google search of:
"close window" javascript html
...produced over 230k hits - the first few contain samples of what you seek.

Regards,
GEWB
LaKisha1
LaKisha1Author
Inspiring
April 27, 2007
Thanks, I'll try that search and take a look at the first few results. The code I currently have works in my Page-level Help (i.e., user clicks Help icon on the page in the system, window opens that displays one HTML page, user clicks Close Window and the window closes); however, in my Site Help which displays the same pages, the Close Window link does not work. I was wondering if it had something to do with the fact that the Site Help window RoboHelp uses has frames and therefore the Close Window link can't close the entire window because of the frames.