Skip to content

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

License

Notifications You must be signed in to change notification settings

jguyet/jiji-container-scrolling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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?

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published