HTML
  Home arrow HTML arrow Page 3 - Completing the HTML Magic Edges Project
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

Completing the HTML Magic Edges Project
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-04-06

    Table of Contents:
  • Completing the HTML Magic Edges Project
  • Code to Shift Right and Left
  • The shiftRight() Function
  • Code to Shift Down and Up
  • Remarks

  • 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


    Completing the HTML Magic Edges Project - The shiftRight() Function


    (Page 3 of 5 )

    This is the function; it is familiar. I will only explain the added statements.


    function shiftRight()

    {

    document.getElementById('Calc').style.left = x;


    //stop scrolling right

    if (x >= 0)

    {

    self.clearInterval(TR);

    //adjust position

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

    processOnL = false;

    edge = "left";

    }


    x+=3;

    }


    This function shifts the inner DIV (pane) and stops the shifting. The processOnL variable, when set to true, indicates that the pane is shifting. It is this same function that has to indicate that the pane has stopped shifting. The if-statement in the function sets this variable to false to indicate this. When the pane has moved from the left mimic edge and settles on the page, the edge variable has to indicate this. The if-statement gives the value of “left” to the edge variable, indicating that the left pane is now out.

    The removePaneL() Function

    The function prepares the page to remove the pane. This is the function:


    function removePaneL()

    {

    if (leftPaneShown == false)

    {

    if (processOnL == false)

    {

    processOnL = true;


    x = document.getElementById('Calc').style.left;

    x = parseInt(x);


    TL = self.setInterval("shiftLeft()",10);

    }

    }


    //reset the leftPaneShown boolean variable

    leftPaneShown = false;

    }


    This function will call another function that will send the pane back to the left edge. So there are two functions involved in sending the pane back to the left edge. The functions (two) to send the pane out from the top edge are different from those to send it out from the left edge. The functions (two) to send the pane back into the top edge are different from those to send it back into the left edge.

    We are still dealing with the above function. Remember that the leftPaneShown variable is used to differentiate between the click on the pane and the click on the BODY outside the pane. When the pane is clicked, two click events actually occur. The one from the pane happens first, followed by the one from the BODY. However, when the BODY is clicked outside the pane, only one click event (the BODY click) occurs. When you click the pane, the leftPaneShown variable is set to true from the onclick event of the outer DIV. When you click only the BODY element, the variable remains false. The statements in the above function will only be executed if the leftPaneShown variable is false, meaning the BODY element was clicked outside the pane. So when this function is called, if the value of this variable is false, then the statements are executed.

    The statements begin with another if-statement. This one checks to see if the pane is still in motion by verifying if the processOnL variable is true. If it is true, it does not execute the statements it has. If it is false, it executes the statements. When it is false, the first statement sets the processOnL variable to true, indicating that the pane is to begin motion or is in motion. Remember, under this condition, nothing can stop the motion of the pane, and no occurrence of the pane can come out of any point of the edges.

    The rest of the statements are familiar. The last one calls the shiftLeft() function every 10ms. It is this shiftLeft() function that actually shifts the pane back into the edge.

    The shiftLeft() Function

    This function shifts the inner DIV back into the edge. It sets the display property of the outer DIV to “none,” making the elements below it free for access (e.g. to be selected by dragging the mouse). The function also resets certain variables and gives the initial position to the outer and inner DIV. With the resets and initial positions given, the whole process can be repeated from the left edge (or top edge by other functions) without conflict. This is the function:


    function shiftLeft()

    {

    document.getElementById('Calc').style.left = x;


    //stop scrolling left

    if (x <= -205)

    {

    self.clearInterval(TL);

    document.getElementById('Cont').style.display = "none";

    processOnL = false;


    //reset the positions of the left movement

    document.getElementById('Cont').style.left = 0;

    document.getElementById('Cont').style.top = 0;

    document.getElementById('Calc').style.left = 0;

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


    paneBack = true;

    }


    x-=3;

    }


    The function should be 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 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek