You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-3Lines changed: 42 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,10 @@ __Examples:__
8
8
9
9
-[Hemeon.com](http://hemeon.com/) by [Marc Hemeon](https://twitter.com/hemeon)
10
10
-[Manik Rathee is a mobile photographer](http://www.manikrathee.com/is/a/mobile-photographer/) by [Manik Rathee](http://twitter.com/manikrathee)
11
+
-[VinThomas.com](http://vinthomas.com/) by [Vin Thomas](https://twitter.com/vinthomas)
11
12
-[The Kozik Cocoon](http://www.kozikcocoon.com/) by [Danny Palmer](http://twitter.com/dannyprose)
12
13
14
+
13
15
__Buy me a coffee:__
14
16
15
17
If you enjoy using Instafeed.js and want to say thanks, you can leave me a small tip using [Gittip](https://www.gittip.com/stevenschobert).
@@ -67,8 +69,8 @@ The only thing you'll need to get going is a valid __client id__ from Instagram'
67
69
-`random` - Random order.
68
70
-`links` (bool) - Wrap the images with a link to the photo on Instagram.
69
71
-`limit` (number) - Maximum number of Images to add. __Max of 60__.
70
-
-`useHttp` (bool) - By default, image urls are protocol-relative (uses `//` prefix). Set to `true`
71
-
to use plain old`http://`.
72
+
-`useHttp` (bool) - By default, image urls are protocol-relative. Set to `true`
73
+
to use the standard`http://`.
72
74
-`resolution` (string) - Size of the images to get. Available options are:
73
75
-`thumbnail` (default) - 150x150
74
76
-`low_resolution` - 306x306
@@ -128,6 +130,42 @@ Notice the `{{link}}` and `{{image}}`? The templating option provides several ta
128
130
-`{{location}}` - Name of the location associated with the image. Defaults to empty string if there isn't one.
129
131
-`{{model}}` - Full JSON object of the image. If you want to get a property of the image that isn't listed above you access it using dot-notation. (ex: `{{model.filter}}` would get the filter used.)
130
132
133
+
## Pagination
134
+
135
+
As of __v1.3__, Instafeed.js has a `.next()` method you can call to load more images from Instagram.
136
+
Under the hood, this uses the _pagination_ data from the API. Additionall, there is a helper
137
+
`.hasNext()` method that you can use to check if there is pagination data.
138
+
139
+
Together these options can be used to create a "Load More" button:
140
+
141
+
```js
142
+
functioncheckLoadMore() {
143
+
// if there are no more results, disable the load more button
144
+
if (!this.hasNext()) {
145
+
loadButton.setAttribute('disabled', 'disabled');
146
+
}
147
+
};
148
+
149
+
functionhandleLoadClick() {
150
+
// load more!
151
+
feed.next();
152
+
};
153
+
154
+
// create our Instafeed instance
155
+
var feed =newInstafeed({
156
+
success: checkLoadMore
157
+
});
158
+
159
+
// grab out load more button
160
+
var loadButton =document.getElementById('#load-more');
0 commit comments