I am inspired by the sleek design of Apple's website and want to replicate some of its features in my project (best viewed on FF, Chrome, Safari):
- Initially, the page appears empty except for the header - but the final height of the page is already set to avoid any sudden changes in the browser scrollbar.
- The different elements of the page (main banner, medium-level banners, last-banners, footer etc) smoothly fade-in one after another from top to bottom.
This smooth transition during page loading creates a stunning effect.
In essence, my webpage will have the following structure:
<header></header>
<div id="content">
<div id="mainImage"></div>
<div id="gallery"></div>
<div id="info"></div>
</div>
<footer></footer>
I have some theories about how Apple achieves this effect, but I am unsure:
- Perhaps all elements are loaded with
opacity:0
initially, and then a script animates their appearance sequentially. However, this might not be the most efficient method. - Another possibility is that each section is loaded via an ajax call, only appearing once fully loaded. Yet, this does not explain the smooth top-to-bottom transition or how the initial page height is determined.
I welcome any suggestions on achieving a similar effect efficiently while keeping the code easy to implement and use.
Any thoughts?