4 Replies Latest reply on Mar 9, 2011 7:25 AM by Dave McGovern

    How To Display WebHelp In A Smaller Browser Window

    wercampbells

      I'm using RoboHelp 8 to develop a WebHelp for a Web-based application. When the help is launched from the application, it covers the entire screen.

       

      How can I make it so the WebHelp only displays in a smaller browser window so it does not cover the entire screen?

       

      Thanks in advance for your help :-)

        • 1. Re: How To Display WebHelp In A Smaller Browser Window
          Jeff_Coatsworth Adobe Community Professional & MVP

          I think that's controlled by the launching program - what method are you using to launch the help?

          • 2. Re: How To Display WebHelp In A Smaller Browser Window
            Dave McGovern

            I use a JavaScript function to accomplish something similar:

             

            function launchWebhelp(filename){
              var filename = filename;
              myWindow=window.open(filename,"","height=500, width=800, left=100, top=100, toolbar=no, menubar=no, resizable=yes, scrollbars=yes");
              }

             

            The above opens a new browser window with the dimensions 500x800 and allows the user to resize it.

             

            In my link, I call it like this:

             

            <a href="javascript:void('0')"onclick="launchWebhelp('http://www.serverName.com/webhelp/project_name.htm')">Project Name</a>

             

            with the URL pointing at the file used to launch the webhelp.  This exact approach may not work for your application (depending on how the help is launched), but hopefully it gives you (or your developer) an idea.

             

            Dave

            • 3. Re: How To Display WebHelp In A Smaller Browser Window
              wercampbells Level 1

              The Help is being called from a link on an ASP page. Do you know how to manage windows size for the help?

               

              Thanks!

              • 4. Re: How To Display WebHelp In A Smaller Browser Window
                Dave McGovern Level 1

                An ASP page is essentially HTML, so you should be able to use JavaScript to do this.

                 

                You have 3 options for inserting the JavaScript in your page:

                 

                1. Inline - insert the code directly where you need it. This is fine if you only have 1 or 2 links that will use it.
                2. In a "script" element. This is useful if you want to reuse the code multiple times on the page.
                3. External file - define the function in an internal file and import it into your page. This is useful when you want to reuse the JavaScript code on multiple pages...and you can change settings in one spot and have them applied everywhere (e.g. if you decide you want to adjust the dimensions).

                 

                Examples of each:

                 

                Example 1: Inline

                Here's an example of an line usage on an <a> link. Replace "project_folder/file_to_launch.htm" with your own URL (either absolute: http://www... or relative: ../my_folder/my_project_launch_file.htm).

                 

                <a href="javascript:void('0')" onclick="window.open('project_folder/file_to_launch.htm','','height=500, width=800, left=100, top=100, toolbar=no, menubar=no, resizable=yes, scrollbars=yes')">My Project</a>

                 

                Example 2: In a <script> Element

                I put this in the <head> of my page:

                 

                <script language="javascript">
                function openWindow(filename){
                  var filename = filename;
                  myWindow=window.open(filename,"","height=500, width=800, left=100, top=100, toolbar=no, menubar=no, resizable=yes, scrollbars=yes");
                  }
                </script>

                 

                Example 3: External File

                The following line in the <head> of the page imports the script defined in the "../resources/launchWebhelp.js" file (obviously, your path and filename will differ).

                <script language="javascript" src="../resources/launchWebhelp.js"></script>

                The definition in the external file is the same as example 2, but without the <script> tags.

                 

                In both examples 2 and 3, I would call the openWindow( ) function the same way:

                 

                <a href="javascript:void('0')" onclick="openWindow('project_folder/file_to_launch.htm')">My Project</a>

                 

                ------------------------------------------------------------------------

                I use this technique for a couple of reasons:

                • Launching the help in a separate window does not "hijack" the user's original session.
                • Opening it in a smaller window informs the user that a new window has been opened because it doesn't hide their original window (unless their original window is even smaller, which is unlikely).
                • It allows me to control the appearance of the new window (you can hide the toolbar and menu bar, for example).

                 

                I fully expect the user to resize or maximize the new window...my content is not optimized to appear within the confines of the smaller window.

                 

                This technique is using the open( ) method associated with the "window" object of the browser.  Here's a link with some information about this method:

                http://www.w3schools.com/jsref/met_win_open.asp

                 

                I hope this helps you out.

                Dave