Simple JavaScript file to load Instagram pictures of a certain tag and infinite scroll through them.
Link to the instagram-scroll.js source file in your webpage.
Add the following code to webpage:
<script>
InstagramScroll({tag: "cats", clientID: "token", imageContainer: "#pics"});
</script>
This will add a ul
to any object on the page with an ID of 'pics' filled with 20 of the most recent Instagram images tagged with 'cats'.
The three necessary parameters for using the function are:
tag
- search term for the images loadedclientID
- given through the Instagram Developer APIimageContainer
- the DOM element where theul
containing the images will be inserted
Optional parameters include:
includeCaption
- add the caption in text after the pictureincludeUsername
- add the username in text after the picture