A Ractive decorator that lazy-loads images when they get close to in view
JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
.npmignore
index.js
package.json
readme.md

readme.md

ractive-lazyload-img

A Ractive decorator that lazy-loads images when they get within 200px of the viewport.

Usage

const lazy = require('ractive-lazyload-img')

new Ractive({
	el: '#content',
	template: '#template',
	decorators: {
		lazy
	}
})
<img
	src="/transparent-pixel.png"
	as-lazy="'/path/to/images/' + dynamicImageName"
/>

License

WTFPL