Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Responsive Media in HTML5

You're reading from   Responsive Media in HTML5 Learn effective administration of responsive media within your website or CMS system using practical techniques

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781849696968
Length 128 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Alex Libby Alex Libby
Author Profile Icon Alex Libby
Alex Libby
Arrow right icon
View More author details
Toc

Table of Contents (7) Chapters Close

Preface 1. Working with Responsive Images FREE CHAPTER 2. Adding Responsive Video Content 3. Mixing Content 4. Testing Responsive Media 5. Using Frameworks Index

Adding lazy loading support to our pages

One of the primary aims of responsive design should be the consideration of any tactic we can use to reduce the overall loading time of our pages; this is particularly true for mobile devices.

So far, you've seen how we can preload content. In some instances, this may not be ideal; instead, we can do the opposite and not load content until we are about to view it:

Adding lazy loading support to our pages

This process is known as lazy loading; it effectively removes the focus of loading the images from the front (that is, on loading of the page) to the point of when we need to see the images. To illustrate the process, we're going to use the bLazy plugin by Bjørn Klinggard, available at http://dinbror.dk/blog/blazy/. The great thing about this library is that it is lightweight and written in pure JavaScript, so has a zero dependency count! Oh and did I forget— it's responsive too.

Let's take a quick look at a demo (based on the original by the author), which...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime