As you may have learned from the API, the jsFloater class gives you a lot of flexibility in your floats, with “stick” values and padding available to add to your floating object x and y values. I thought it might be useful, however, to break down some of the available methods in terms of a box model, to help explain two different types of floating you can use: what we’re calling proportional and strict.
jsFloater requires you to define a minimum and width and height for your stage, so that you can take a given design comp and figure out how small the browser window can get before the objects begin crashing into each other and/or overlapping in undersirable ways. This is an issue common to liquid GUIs / layouts, one which jsFloater lets you fix. But, you may not always want your elements to float based upon the very edges of the current browser window: if, for example, your design comp figures at a minimum window size of 800 x 600, you may want your elements to float somewhere between the minimum value and the edge of the window. You could accomplish that with typical liquid GUI layout types and a bunch of your own math – or, you could let jsFloater do it for you, using the proportional float modes available.
We’ll examine the basic boxes in a moment, but first let’s recap the horizontal and vertical floats. The images below are all taken from the jsFloater visual API example, which can also be exported from the FLA file included in the download. It may help you to have the visual API guide open while you read through this example, so you can experiment and see how the objects move and react.
First, let’s look at the available align modes for the floatVer (vertical) method.
(more…)