Home arrow HTML arrow Page 3 - 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 - Modification to the maximizeFn(ID) and the restoreFn(ID) functions
(Page 3 of 4 )

The maximizeFn(ID) function is now,


function maximizeFn(ID)

{

//stop scrolling by clearing the Interval timing

clearInterval(TIDI);

 

document.getElementById(ID).style.position="absolute";

document.getElementById(ID).style.zIndex="2";

document.getElementById(ID).style.width="400";

document.getElementById(ID).style.height="400";

document.getElementById(ID).title="Click to Restore";

 

maximized = true;

}


Recall that the aim of the “maximizeFn(ID)” function is to maximize the image. If you are maximizing an image in the freezing or manual mode, the old maximizeFn(ID) function suffices. However, if you are maximizing in the automatic mode, will the planes continue to change? The planes should not continue to change. So the first thing the new “maximizeFn(ID)” function does is stop the automatic process. It does so with the statement,


clearInterval(TIDI);


using the global variable, TIDI.


The rest of the statements are as before.


The “restoreFn(ID)” function has more changes. It is now,


function restoreFn(ID)

{

document.getElementById(ID).style.position="relative";

document.getElementById(ID).style.zIndex="1";

document.getElementById(ID).style.width="100";

document.getElementById(ID).style.height="100";

document.getElementById(ID).title="Click to Maximize";

 

maximized = false;

 

//continue scrolling if you are not in manual mode.

if (manualScrolling == false)

{

present--;

if (present == -1)

present = 2; //the last plane

scrollInwardCont();

}

}


All of the statements in the old functions are still there. After that you have a new section. When you click a maximized image to have it restored, if you are in the freezing or manual mode, the old statements of the “restoreFn(ID)” function suffice, since to continue working in that mode, there is no special requirement. However, if you are in the automatic mode, it would be proper if you do not go to the next plane but continue to display the present plane for an interval of time. This is because the user might not have finished glancing through all the images of the plane.

Recall that the “scrollInward()” function will always display the next plane. Also recall that the "present" variable is a global variable, which the “scrollInward()” function uses (increments) to determine the next plane. The added section in the “restoreFn(ID)” function first checks to see if you are in the automatic mode. To know if you are in the automatic mode, you simply have to know if the manualScrolling global variable is false. If it is false, you decrement the "present" global variable. This section of code calls the “scrollInward()” function through the scrollInwardCont() function. The aim of the “scrollInward()” function is to display the next plane. If the "present" variable is decremented, the function will re-display the present plane.

If the value of the "present" variable is zero and you decrement it, you will have –1. There is no plane having the index of –1. In this case you have to set the variable preset to 2, which is the index in the reverse order.

The explanation of the added section in the “restoreFn(ID)” function should now be clear.


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