Home arrow HTML arrow Page 3 - Mimic Edge for HTML Magic Edges
HTML

Mimic Edge for HTML Magic Edges


In this second part of a five-part series, we will see how the inner DIV element (pane) can scroll from the top of the outer DIV element, downward. We shall also see how to make the left edge of your web page respond to events, and how the pane can scroll out of it.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
March 16, 2009
TABLE OF CONTENTS:
  1. · Mimic Edge for HTML Magic Edges
  2. · Scrolling from the web page edge
  3. · Basic Implementation of Magic Edge
  4. · Scrolling from the Left Edge

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
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.


blog comments powered by Disqus
HTML ARTICLES

- HTML5 Boilerplate: Working with jQuery and M...
- HTML5 Boilerplate Introduction
- New API Platform for HTML5
- BBC Adopts HTML 5, Mozilla Addresses Issues
- Advanced Sticky Footers in HTML and CSS
- HTML and CSS Sticky Footers
- Strategy Analytics Predicts HTML5 Phones to ...
- HTML5 Guidelines for Web Developers
- Learning HTML5 Game Programming
- More Engaging CSS3 and HTML Background Effec...
- Engaging HTML and CSS3 Background Effects
- More Web Columns with CSS3 and HTML
- Columns with CSS3 and HTML
- Creating Inline-Block HTML Elements with CSS
- Drag and Drop in HTML5: Parsing Local Files

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials