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

Using preloaders to reduce delays

Preloading content is not a new concept in the world of web design. The idea is to reduce the amount of time it takes to view the page in a browser, as some (or all) of the content has been fetched ahead of viewing the page and cached in the browser.

There are plenty of examples available using JavaScript (such as PreloadJS at http://www.createjs.com/#!/PreloadJS). But this adds an extra overhead to our pages that we can avoid, particularly in a responsive design.

Instead, we can use CSS to achieve the same effect, provided the styles and images are called at the right time. This way, they will be ready for us when we render the images on screen.

Note

For the purposes of this demo, I've simplified the code to concentrate on the preloading process only.

Let's take a look at preloading in action with a simple demo:

  1. From the code download that accompanies this book, extract a copy of preloading.html and then save it in our project folder.
  2. Next, extract...

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