Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Responsive Media in HTML5
  • Table Of Contents Toc
  • Feedback & Rating feedback
Responsive Media in HTML5

Responsive Media in HTML5

By : Alex Libby
close
close
Responsive Media in HTML5

Responsive Media in HTML5

By: Alex Libby

Overview of this book

If you are a web designer with a good understanding of CSS, jQuery, and HTML, but new to creating responsive sites, then this book is for you. The prerequisite is a good understanding of CSS and HTML; the demos will suit those who have some prior knowledge of Less CSS, WordPress, or Bootstrap.
Table of Contents (7 chapters)
close
close
6
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...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY