Skip to content

bhavishay97/infinite-scroll

Repository files navigation

Infinite scroll

A web page to demonstrate infinite scroll functionality which can be seen in many websites nowadays. Every time the user scrolls down to the bottom of the page more content is loaded.

In this web page initially only 5 images are loaded from the API. As the user scrolls down another request to API is made to fetch more images resulting in an infinite scroll.

API used - Unsplash

To try it out follow these steps :

  1. Clone the repo.
  2. Open the script.js file in your text editor.
  3. Replace the value of apiKey constant with your own API key from Unsplash.
  4. Save the changes.
  5. Now fire up the index.html file and keep scrolling.

Screenshots below :

initial screen

more images loaded when user scrolls down

mobile view 1

mobile view 2       mobile view 3