HTML
  Home arrow HTML arrow Page 2 - Mimic Edge for HTML Magic Edges
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Mimic Edge for HTML Magic Edges
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-03-16

    Table of Contents:
  • Mimic Edge for HTML Magic Edges
  • Scrolling from the web page edge
  • Basic Implementation of Magic Edge
  • Scrolling from the Left Edge

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Mimic Edge for HTML Magic Edges - Scrolling from the web page edge


    (Page 2 of 4 )

    We are still covering the basics. The edge of the web page is not a DOM object, whose events we can exploit to make the inner DIV element appear to come out of it. We have to mimic this.

    We shall use an HTML element that has events. The element I have chosen for the left edge is the DIV element. We shall make the width of this DIV element one pixel. For now, we shall put the element next to the real edge of the page. The length of the element should be as long as the actual edge of the client area of the web page. We shall align one edge of the outer DIV element above with this one pixel-width element.

    We shall write our script such that, when the mouse pointer goes over the one pixel-width element, the inner DIV element will come out of the aligned edge of the outer DIV element. This way the inner DIV element will appear to come out of the edge of the web page. This means we shall remove the border of the outer DIV element. In fact, we shall give it a zero width border.

    Our one pixel HTML element is the mimic edge. Our mimic left edge will be a DIV element with zero padding, zero border and zero margin. Note that the padding, border and margin make an element effectively larger in size.

    For the mimic edge to be at the web page edge, the BODY element should have zero padding and zero margin. We cannot give it zero border. If we do, the demarcation of the BODY edge will not be shown. HTML elements use the border to identify their edges. So the CSS statement for the BODY element should now be:

    body {background-color:#ff9933;padding:0px; margin:0px}

    Background Color of the Mimic Edge

    The color (background) of the mimic edge has to be the background color of the BODY element. In this way the user will not notice it. However, if the background of your BODY element is an image, then the problem becomes rather difficult. Under this condition, there is a way of giving it a color (background), which will make it less noticeable or not noticeable at all.

    Here is a metaphor to explain how. When I was at college, I put on a shirt and a pair of trousers. I asked my sister if that combination matched. She said “yes.” Before then I always decided if my shirt matched my trousers by looking at myself in the mirror. She gave me the following rule to always know if my shirt and trousers match: she said if the color of the trousers is found in the shirt, then the shirt and trousers match. The rule is correct.

    As the scientific people that we are, let us give some more precision to the rule. Trousers usually have one color for the entire pair. Many shirts have several colors. Now you know the condition under which she gave me the rule. This rule can be used in a similar way with the web page.

    On the web page you have several colors, and in some cases many. We want a color (background) for the mimic edge that will match (look okay to the eye) the rest of the web page. If we choose a color that is on the web page for our mimic edge, we would therefore have a match between the web page and the mimic edge.

    This is my extension to the rule: when in doubt as to which color to choose, choose the color that appears the most (greatest percentage of occurrence) on the web page. In this way, matching will surely occur. Our real aim is that the mimic edge should be less noticeable or not noticed at all. So when matching occurs, the mimic edge is seen as an integral part of the page.

    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek