Adapt.js Jump Start PRO

Adapt.js is a simple tiny JavaScript library that allows you to develop web pages that automatically adjust themselves to the web browser screen size. The Adapt.js library dynamically checks the width of the web browser and serves the CSS file for that width.

The following video shows how simple it is to use this library and how Adapt.js dynamically load the relevant CSS file when the web browser width changes.

The code shown in this video clip is available below. Make sure you fix the relative links to the JavaScript and the CSS files.

<!DOCTYPE html>
<html>
<head>
<title>Adapt.js Jump Start</title>
<script>
var ADAPT_CONFIG = {
  path: 'css/',
  dynamic: true,
  range: [
    '0px    to 720px  = mobile.min.css',
    '720px  to 980px  = 720.min.css',
    '980px  to 1280px = 980.min.css',
    '1280px           = 1280.min.css'
  ]
};
</script>
<script src="js/adapt.min.js"></script>
</head>
<body>
    <h1>Adapt.js Jump Start</h1>
</body>
</html>

You can find the complete sample with all the other files it uses as well as slides and video clips for learning how to use the Adapt.js library in my new Adapt.js Basics free course at http://abelski.lifemichael.com.

Share:

banner for the css playlist in hebrew life michael courses for programmers

The First Steps in CSS

Learn CSS using our our videos (in Hebrew) on the CSS (he) playlist on youtube. Do it now. Do it for free.

Good Trainers Collaborate with Others

It is always essential to keep an open mind and learn from others. This applies to everyone, including teachers and especially software development trainers. Software

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences