Home arrow HTML arrow Page 2 - Completing a 3D HTML Table Image Gallery
HTML

Completing a 3D HTML Table Image Gallery


In the first two articles of this series, I showed you a number of steps involved in constructing a 3D HTML table and putting an image gallery in such a table. I discussed the capabilities we'd want our gallery to have, and the three modes in which it would function. In this conclusion to the series, I will show you how to get those modes working and pull everything together.

Author Info:
By: Chrysanthus Forcha
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
February 17, 2009
TABLE OF CONTENTS:
  1. · Completing a 3D HTML Table Image Gallery
  2. · Freezing and Manual Modes
  3. · Modification to the maximizeFn(ID) and the restoreFn(ID) functions
  4. · Advantages of the Image Gallery in a 3D HTML Table

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Completing a 3D HTML Table Image Gallery - Freezing and Manual Modes
(Page 2 of 4 )

The Freezing Mode

The function that does freezing is,


function freezeAuto()

{

//Only manual scrolling should be possible after maximization

manualScrolling = true;

 

clearInterval(TIDI);

}


freezeAuto means freeze the automatic process at a particular plane. This is the name I have chosen to use; you can give it your own name. The function starts by setting the manualScrolling variable to true. This indicates that the planes can be changed manually. Then it simply stops the DOM “setInterval()” function from re-executing, with the statement:


clearInterval(TIDI);


clearInterval() is also a DOM function. Its purpose, established by the DOM, is to stop the setInterval() function from re-executing. It uses the ID returned by “setInterval()” to achieve its goal. I hope you can now see why the returned ID assigned to the variable is made global.

There are only two statements in the function. As we said, the manualScrolling variable is global. The maximizeFn(ID) and the restoreFn(ID) function have to read this variable before taking certain actions (see below).

The Manual Mode

The aim of this mode is to enable the user to scroll the sets (change the sets) manually. The function is:


function scrollInwardMan()

{

//set manual scroll variable to true

manualScrolling = true;

//stop auto scrolling

clearInterval(TIDI);

scrollInward(); //show next set

}


scrollInwardMan means Scroll Inward Manually. This is the name I chose; you can give it your own name. The function starts by setting the manualScrolling variable to true. The “maximizeFn(ID)” and the “restoreFn(ID)” function have to read this variable before taking certain actions (see below). It then stops the DOM “setInterval()” function from re-executing, with the statement:


clearInterval(TIDI);


Finally it calls the “scrollInward()” function, which has the effect of displaying the next plane. We talked about the scrollInward() function in the first part of this series.

The continueAuto() Function

continueAuto() stands for Continue Automatic process. This is the name I chose to give it; you can give it your own name. The function is,


function continueAuto()

{

scrollInward(); //show next set without waiting for the interval to elapse

scrollInwardCont(); //call the continuous function

}


This is the function that is called when you want to leave the freezing or automatic mode. When you are in the freezing or manual mode, it is assumed that you have seen what you want to see in the present plane. So the function starts by displaying the next plane; calling the “scrollInward()” function achieves that. Next and finally, it calls the scrollInwardCont() function, which puts the page in the automatic mode. So, each time the “scrollInwardMan()” is called, it displays a new plane.

The Buttons Tags

Before we see how the code maximizes and restores images, let us see the tags for the three buttons we spoke about earlier. We have,


<button type="button" onclick="freezeAuto()">Freeze Set</button>


<button type="button" onclick="continueAuto()">Continue Automatically</button>


<button type="button" onclick="scrollInwardMan()">Next Set Manually</button>


As you can see, these buttons call the functions for the three modes. However, the “Continue Automatically” button is clicked when you want to leave the freezing or manual mode. It returns the page to its default mode.


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 1 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials