DefinitelyTyped/types/jquery-lazyload/jquery-lazyload-tests.ts
Anderson Friaça 9075daa897 JQuery Lazy Load - Adjustment in type appear (#24799)
* Adjustment in type appear

* Allow type null in appear

* Adjustments
2018-04-09 12:53:04 -07:00

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");
});
});