mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
24 lines
594 B
TypeScript
24 lines
594 B
TypeScript
$(document).ready(() => {
|
|
// basic usage
|
|
$('.lazyload').lazyload();
|
|
|
|
// with options
|
|
const options: JQueryLazyLoad.Options = {
|
|
threshold: 200,
|
|
event: 'click',
|
|
effect: 'fadeIn',
|
|
container: $('#container'),
|
|
failure_limit: 10,
|
|
skip_invisible: true,
|
|
appear: (elementsLeft: number, settings: JQueryLazyLoad.Options) => {
|
|
console.log(elementsLeft);
|
|
}
|
|
};
|
|
$('.lazyload').lazyload(options);
|
|
|
|
// event on load
|
|
$('.lazyload').on('load', () => {
|
|
$("img.lazy").trigger("click");
|
|
});
|
|
});
|