Mimic Edge for HTML Magic Edges - Basic Implementation of Magic Edge
(Page 3 of 4 )
In this section, we shall consider the case where the calculator (inner DIV element) comes out of the left edge of the page and goes back when required.
Scrolling Out From and Back into the Left Edge
We need to put a mimic edge just next to the left edge. Our mimic edge is a DIV element. So we create a DIV element whose height is that of the height of the client area of the screen. The width is 1px. The element is given zero padding, zero border and zero margin.
It is also given a CSS value of “inline” to its display property. In this way, you put it as the first element of the web page. As such it will be located next to the left edge. Because of its CSS inline value, web page elements will be placed on its right. It is given an onmouseover event, which triggers the scrolling out of the inner DIV element.
Getting the Height of the Client Area of the Web Page
The DOM screen object has the availHeight property. This is the height of the screen without the taskbar. We shall use the screen object and this property to obtain the height of the screen. For simplicity, we shall use this as the height of the mimic edge.
Since the web page has toolbars, and we usually do not know how many toolbars the user will have, the mimic edge will extend below the taskbar. If we want to have the exact height of the client area, then we would need to know the number of toolbars and their heights. In theory this can be done, but browsers today would not support your efforts. In theory we can also look for the height of the entire page, but that is difficult. So we shall use the screen height for the client height.
Next: Scrolling from the Left Edge >>
More HTML Articles
More By Chrysanthus Forcha