Lazy Element Plugin
Fatih Kadir Akın edited this page Apr 26, 2016
·
3 revisions
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bricklayer/<version>/bricklayer.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/bricklayer/<version>/bricklayer.min.js"></script>
<!-- You should also add bricklayer.lazyElement.js -->
<script src="//cdnjs.cloudflare.com/ajax/libs/bricklayer/<version>/plugins/lazyElement/bricklayer.lazyElement.min.js"></script>
For advanced installation options plase see installations page.
Note: Lazy Element Plugin doesn't have NPM or Bower installations yet.
Lazy Element Load is used to add elements lazily.
// Element will append 1s later.
bricklayer.appendLazyElement(function (done) {
setTimeout(function () {
done(element)
}, 1000)
})
// Image will wait source to be loaded to append.
bricklayer.appendLazyElement(function (done) {
var image = new Image()
image.src = "demo.jpg"
image.onload = function () {
done(image)
}
})
If you have any questions, please chat us on Gitter!
Copyright © Bricklayer.js - Adem İlter, Fatih Kadir Akın
- Quick Start
- Installation
- Examples
- Methods
- Events
- Responsiveness
- Plugins
- Frameworks
- License