Skip to content

Commit

Permalink
📝 Revise README for v5
Browse files Browse the repository at this point in the history
- add files to package.json
- bower.json deps
  • Loading branch information
desandro committed Feb 18, 2022
1 parent 4accfda commit 26d823c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 39 deletions.
71 changes: 36 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@

<p class="tagline">JavaScript is all like "You images done yet or what?"</p>

[imagesloaded.desandro.com](http://imagesloaded.desandro.com)
[imagesloaded.desandro.com](https://imagesloaded.desandro.com)

Detect when images have been loaded.

## Install

### Download

+ [imagesloaded.pkgd.min.js](https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.min.js) minified
+ [imagesloaded.pkgd.js](https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.js) un-minified
+ [imagesloaded.pkgd.min.js](https://unpkg.com/imagesloaded@5/imagesloaded.pkgd.min.js) minified
+ [imagesloaded.pkgd.js](https://unpkg.com/imagesloaded@5/imagesloaded.pkgd.js) un-minified

### CDN

``` html
<script src="https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.min.js"></script>
<script src="https://unpkg.com/imagesloaded@5/imagesloaded.pkgd.min.js"></script>
<!-- or -->
<script src="https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.js"></script>
<script src="https://unpkg.com/imagesloaded@5/imagesloaded.pkgd.js"></script>
```

### Package managers

Install via [npm](https://www.npmjs.com/package/imagesloaded): `npm install imagesloaded`
Install via npm: `npm install imagesloaded`

Install via [Bower](http://bower.io): `bower install imagesloaded --save`
Install via Yarn: `yarn add imagesloaded`

## jQuery

Expand Down Expand Up @@ -238,78 +238,79 @@ imgLoad.on( 'always', function() {
});
```

## Browserify
## Webpack

imagesLoaded works with [Browserify](http://browserify.org/).
Install imagesLoaded with npm.

``` bash
npm install imagesloaded --save
npm install imagesloaded
```

You can then `require('imagesloaded')`.

``` js
// main.js
var imagesLoaded = require('imagesloaded');

imagesLoaded( elem, function() {...} );
imagesLoaded( '#container', function() {
// images have loaded
});
```

Use `.makeJQueryPlugin` to make to use `.imagesLoaded()` jQuery plugin.
Use `.makeJQueryPlugin` to make `.imagesLoaded()` jQuery plugin.

``` js
var $ = require('jquery');
// main.js
var imagesLoaded = require('imagesloaded');
var $ = require('jquery');

// provide jQuery argument
imagesLoaded.makeJQueryPlugin( $ );
// now use .imagesLoaded() jQuery plugin
$('#container').imagesLoaded( function() {...});
```

## Webpack

Install imagesLoaded with npm.
Run webpack.

``` bash
npm install imagesloaded
webpack main.js bundle.js
```

You can then `require('imagesloaded')`.
## Browserify

imagesLoaded works with [Browserify](http://browserify.org/).

``` bash
npm install imagesloaded --save
```

``` js
// main.js
var imagesLoaded = require('imagesloaded');

imagesLoaded( '#container', function() {
// images have loaded
});
imagesLoaded( elem, function() {...} );
```

Use `.makeJQueryPlugin` to make `.imagesLoaded()` jQuery plugin.
Use `.makeJQueryPlugin` to make to use `.imagesLoaded()` jQuery plugin.

``` js
// main.js
var imagesLoaded = require('imagesloaded');
var $ = require('jquery');
var imagesLoaded = require('imagesloaded');

// provide jQuery argument
imagesLoaded.makeJQueryPlugin( $ );
// now use .imagesLoaded() jQuery plugin
$('#container').imagesLoaded( function() {...});
```

Run webpack.

``` bash
webpack main.js bundle.js
```

## Browser support

+ IE9+
+ Android 2.3+
+ iOS Safari 4+
+ All other modern browsers
+ Chrome 49+
+ Firefox 41+
+ Edge 14+
+ iOS Safari 8+

Use [imagesLoaded v3](http://imagesloaded.desandro.com/v3/) for IE8 support.
Use [imagesLoaded v4](https://github.com/desandro/imagesloaded/tree/v4.1.4) for Internet Explorer and other older browser support.

## Development

Expand Down
6 changes: 2 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
"description": "JavaScript is all like _You images done yet or what?_",
"main": "imagesloaded.js",
"dependencies": {
"ev-emitter": "^1.0.0"
"ev-emitter": "^2.1.2"
},
"devDependencies": {
"jquery": ">=1.9 <4.0",
"qunit": "^2.0.0"
},
"ignore": [
"**/.*",
Expand All @@ -21,7 +19,7 @@
"gulpfile.js",
"contributing.md"
],
"homepage": "http://imagesloaded.desandro.com",
"homepage": "https://imagesloaded.desandro.com",
"authors": [
"David DeSandro"
],
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "4.1.4",
"description": "JavaScript is all like _You images done yet or what?_",
"main": "imagesloaded.js",
"files": [
"imagesloaded*.js"
],
"dependencies": {
"ev-emitter": "^2.1.2"
},
Expand Down

0 comments on commit 26d823c

Please sign in to comment.