Skip to content

alt-j/echo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Echo Build Status

Echo is a standalone JavaScript lazy-loading image tool. Echo is fast, less than 1KB and uses HTML5 data-* attributes.

<img src="img/blank.gif" alt="Photo" data-echo="img/photo.jpg">

Demo

Check out a demo of Echo.

Installing with Bower

To install Echo into your project using Bower, use the GitHub repository hook:

bower install https://github.com/toddmotto/echo.git

Manual installation

Drop your files into your required folders, make sure you're using the file(s) from the dist folder, which is the compiled production-ready code. Ensure you place the script before the closing </body> tag so the DOM tree is populated when the script runs.

<body>
	<!-- html content above -->
	<script src="dist/echo.js"></script>
  <script>
  // call Echo.js
  Echo.init();
  </script>
</body>

Configuring Echo

Add the image that needs to load when visible in a data-echo attribute:

<img src="img/blank.gif" alt="Photo" data-echo="img/photo.jpg">

Scaffolding

Project files and folder structure.

├── dist/
│   ├── echo.js
│   └── echo.min.js
├── src/
│   ├──	compatibility/
│   │   ├──	array/
│   │   │	└──	indexOf.js
│   │   └──	document/
│   │      └── querySelectorAll.js
│   └── echo.js
├── .editorconfig
├── .gitignore
├── .jshintrc
├── .travis.yml
├── Gruntfile.js
└── package.json

License

MIT license

About

Lazy-loading images with data-* attributes

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%