Sample 4: Positioning and Floating
With the "1 x 1 table" technique, you can position menus relatively against other html elements easily, but it won't help a lot when you are thinking of some special positions, say, the bottom-right corner of the browser window. G2's Easy-Positioning feature is to address such concerns.
Easy-Positioning let you choose from the following 9 positions for your menus(The last position[8] might have little usage, it's given there just in case):
|
A floating menu can be absolutely or relatively positioned initially, it then jumps back to the same position according to the window when the page scrolls.
Usually floating menus in G2 are taking advantage of the Easy-Positioning feature. The sample menu bar given here sits at position [4] and opens to the top-left direction(The following lines help to force the browser to show the scrollbars and let you see how the floating menu moves around).
![]() |
![]() |