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

yields/load-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

load an image

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •