Default window size for webhelp?

Posts: 86
Location: USA

Default window size for webhelp?

Tue Jan 03, 2017 7:52 pm

I have a requirement to force the initial window size for webhelp content to 580x700. How can I set this initial window size? I've tried setting:

Code: Select all

<script Language="JavaScript">
          var width=580;
          var height=700;

in wt_index.html, wt_search.html, wt_terms.html and wt_topic.html, but it does not appear to change the default window size.
Scott Hudson
Content Strategist
Posts: 195

Re: Default window size for webhelp?

Wed Jan 04, 2017 5:32 pm


You cannot resize or set the position of a browser window on the page load.
You can change only the properties of a new window opened by your script. This means that you should open a new window and set the properties you want: width, height, offset top and offset left.
Here is the script that will do this:

Code: Select all

        var myWindow;

        var width=580;
        var height=700;
        var availHeight = screen.availHeight;
        var availWidth = screen.availWidth;
        var positionX = (availWidth-width)/2;
        var positionY = (availHeight-height)/2;
        var requestedURL = window.location;

        if (!=="myWindow") {
            window.document.write("<p>This page open a new WebHelp window!</p>");
            myWindow =, "myWindow", "width=" + width + ", height=" + height + ", left=" + positionX + ", top=" + positionY);

You have to include it in the wt_index.html, wt_search.html, wt_terms.html and wt_topic.html files.

Bogdan Cercelaru
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 1 guest