Book Image

Responsive Design High Performance

By : Dewald C Els, Dewald Els
Book Image

Responsive Design High Performance

By: Dewald C Els, Dewald Els

Overview of this book

Table of Contents (16 chapters)
Responsive Design High Performance
About the Author
About the Reviewers
Speeding Up Development with Design Concepts, Patterns, and Programs

One-to-many DOM elements

I briefly touched on this subject in the previous chapter, so let's talk about this a bit more. A great article about showing and hiding elements by Josh Powell can be found at

He compared the speed of showing and hiding elements using different techniques and found that the enabling and disabling of style sheets is the fastest method to show and hide elements on your page. Now, for responsive design, this is very handy, but I feel that hiding elements is being used rather carelessly. When an element is hidden from the viewport of your browser, it still renders when the page is loaded. If you have a lot of elements, they'll all have to render before the page has finished loading. Even worse, if you have images in the section that you are hiding, those requests are still being made to the server.

I propose a better solution. Create a simple rendering function or two rendering functions that...