Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Latest commit

 

History

History
26 lines (17 loc) · 377 Bytes

Readme.md

File metadata and controls

26 lines (17 loc) · 377 Bytes

load-image

Creates and loads an image.

Installation

$ component install yields/load-image

Example

var image = require('load-image');
var body = document.body;
body.className = 'loading';
image('/foo.jpg', function(err, img){
  if (err) throw err;
  body.className = '';
  body.style.background = 'url(' + img.src + ')';
});

License

MIT