HTML
  Home arrow HTML arrow 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


    (Page 1 of 4 )

    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.

    Scrolling from the Top

    In this section we see how the inner DIV element can be made to scroll from the top downward. Here, instead of changing the CSS left value, we shall be changing the CSS top value. The height of the inner DIV element is 196px. So the initial top value of the inner DIV element is –196px. This value should be written as a CSS attribute to the inner DIV element and not in the style sheet. I gave the reason in the previous part of the series.

    The default left value is zero pixels. So you can omit the left attribute (style). With these factors, the inner DIV element will start scrolling from the top. This is the script which will accomplish that:


    <script type="text/javascript">


    var y = document.getElementById('Calc').style.top;

    y = parseInt(y);


    var TT = self.setInterval("shiftDown()",10);


    function shiftDown()

    {

    document.getElementById('Calc').style.top = y;

    if (y >= 0)

    {

    self.clearInterval(TT);

    //adjust position

    document.getElementById('Calc').style.top = "0px"

    }

    y+=3;

    }


    </script>


    Replace the former script with this one. Put the script below the DIV elements. The operation of this and the former scripts are the same. However, the variables and the left attribute value have changed. Instead of x, for horizontal distance, we have y. The choice of y is just to make things consistent with the Cartesian coordinate system, where horizontal distance is identified by the x variable and vertical distance is identified by the y variable.

    The ID returned by the setInterval() function is now TT instead of TL. The shiftRight() function is now shiftDown(). The CSS left attribute for the inner DIV object is now "top" instead of "left." Everything else stays the same. The script is then self-explanatory.


    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