1.0.3 • Published 3 years ago

jiji-container-scrolling v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

jiji-container-scrolling

NPM version license

Javascript librarie for load intelligently list of pictures or greedy elements html.

For the container element this librarie check all elements contained in container and an of an of three function is called for all elements

example :

<div id="photos">
    <img src="...">
    <img src="...">
    <img src="...">
    ... 3000 other pictures
</div>

I want load pictures only if is displayable.

const JijiContainerScrolling = require("jiji-container-scrolling");

let visibleFunctionCallBack = (element) => {
    element.src = "...";
};
let partialVisibleFunction = (element) => {};
let unVisibleFunction = (element) => {};

// visibleFunctionCallBack is callled if element visible in first parameter scrolling through each event
JijiContainerScrolling.init(document.getElementById('photos'), visibleFunctionCallBack, partialVisibleFunction, unVisibleFunction);

// manual check is callled if element visible in first parameter scrolling through each event
JijiContainerScrolling.checkVisibleContainerElementsWithoutCallBack(document.getElementById('photos'), visibleFunctionCallBack, partialVisibleFunction, unVisibleFunction);

If you search a simple framework js see jiji-js.io: https://jiji-js.io

Ref: How to check if element is visible after scrolling?