导航菜单

GitHub

Fast Image Compression & Utility Library

Introduction

The Fast Image library gives you easy ways to load your images faster with compression and preloading directly in your client (front-end) side application with minal to no additional setup.

Installation

First, refrence the library in your JavaScript & HTML project's header, using the imports below! Then confirm that have images on your page or add one for testing, otherwise the script won't do anything - oviously - and call the preloading meathod in the head, if you've enabled that module, like shown below.

Pro Tip: You can replace scripts.caviel.com with the one of our mirror links listed at the bottom of the page.

// Import Your FastImage Module(s)// Call The Preloader FastImagePreloader.start(document)

Third, add your precomposed compressed image links to your images like demonstrated below, if you do not do this we will automaticly use the link you have with the comp suffix at the end before the extension. (I.G. './my_image_link-comp.jpg'.)

// Standard Flag Syntax// Aliased Flag Syntax

And lastly, add the refrence script at the bottom of your page, elements are not loaded in yet so don't put this at the top/head of your page.

// ... FastImageCompressor.start(document); CollaboratorsMain Developer - @PigerlyMirrors

JsDelivr: https://cdn.jsdelivr.net/gh/CavielLibraries/FastImage/

CodeHost: https://raw.codehost.org/caviel/fastimage/

相关推荐: