For this example, we modify Example 11 to provide an external function that computes the desired size of the HAniS window whenever the user re-sizes the browser window.
In this example, as you will see, the HAniS "window" is configured to be to the right of a "navigation" panel, and vertically placed between a "header" and a "footer".
The JavaScript code sets an event listener on the "window resize event" that simply calls the function named "setwin" that is also part of this script and computes how much space is now available for HAniS.
Once this computation is done, it then calls HAniS.setWindowSize() to tell HAniS to resize its display.
The "setwin" function is defined separately so that HAniS can also call it after HAniS initializes (see the "setup" call below).
This script is defined in the <head> element as follows:
In addition, the HAniS.setup() function call adds the optional 3rd parameter that is a callback to the setwin() method, defined above. This causes the initial window to be sized appropriately. The <body> element looks like this
<body style="overflow:hidden;" onload="HAniS.setup('hanist11t.txt','handiv', setwin)">