Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pacez/esayImgPreloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

11 Commits

Repository files navigation

EasyImgPreloader

Image preloader, suitable for the need to load image resources in advance of the scenario.

tips: Image loading failure, we also identified as the loaded.

Install

npm i easy-img-preloader
// or
yarn add easy-img-preloader

Basic Usage

easyImgPreloader(images,callback,timeout);

Params

name type default Required Desc
images Array [] true Image list
callback (progress) => {} - - The loaded complete
timeout Int 5000 - The load timeout for each image

Examples

import easyImgPreloader from 'easy-img-preloader';
easyImgPreloader([
 require('./p1.png'), // preload local image
 'http://www.test.com/p2.png' // preload remote image
],(progress)=>{
 progress === 1 && console.log('All images have been loaded');
},3000);

About

Image preloader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /