Book Image

Web Design Blueprints

Book Image

Web Design Blueprints

Overview of this book

The book delivers simple instructions on how to design and build modern Web using the latest trends in web development. You will learn how to design responsive websites, created with modern Flat User Interface design patterns, build deep-scrolling websites with parallax 3D effects, and roll-your-own single-page applications. Finally, you'll work through an awesome chapter that combines them all. Each chapter features actual lines of code that you can apply right away.
Table of Contents (12 chapters)
Web Design Blueprints
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Loading the page functions


The first function, the body.onload function, will next call another function, called smoothScrollTo, as a property of the window, sending the value of the document body's scrollHeight property. At the bottom of the script, create that function, and it will make the page scroll smoothly through to the bottom of the full document body.

We will fill it out shortly, but first, we will finish the last line of this function. We will add an onscroll attribute to the body with the value calling a function called updateElement. The updateElement function is the most vital one for our parallax effect, so hang on and we'll write it shortly. Look at this code sample:

document.getElementById("body").onload = function(){
    smoothScrollTo(document.body.scrollHeight);
    document.getElementsByTagName("body")[0].setAttribute("onscroll","updateElement()")
};
window.smoothScrollTo = ()