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

Collecting the moving elements


If the previous condition is true, we need to collect the SVG icons in an array and then get the class of each one. Each class will behave differently. Go through another loop that gathers the current row element's child elements identified by the tag name I. And then loop through each of those children's list of classes collected by the classList method. I will show you how this will look before I tell you what we will do with it. Take a look at the loop in a loop in a loop in this code sample:

    function getMovingElements(callback){
        for (var i = 0;i<document.getElementsByClassName("row").length; i++)
{
            if((window.pageYOffset + (window.innerHeight)) > document.getElementsByClassName("row")[i].offsetTop && (window.pageYOffset) < (document.getElementsByClassName("row")[i].offsetTop + (window.innerHeight/2*3)))
{
                for (j = 0; j < document.getElementsByClassName("row")[i].getElementsByTagName("i").length...