# 🎞️ 1. How to Create an Auto-Play Slideshow

**URL:** https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271
**Category:** Community Resources
**Tags:** custom-css, tutorial, custom-code
**Created:** [May 11, 2024, 7:35am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271 "2024-05-11T07:35:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [May 11, 2024, 7:35am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/1 "2024-05-11T07:35:38Z")

</div>

Here’s how to create an autoplay slideshow with a duration based on the update interval of Glide (5-10 seconds), without using HTML or CSS:

![ScreenRecording2024-05-11at13.34.01-ezgif.com-resize](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/2/2213d822db319ea3cb736cf8a331dc44e15f51b0.gif)

 ![Screenshot 2024-05-11 at 13.28.42](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/5/8599d49b2ff6909b6197d7a4d8f1a81ae5f1b6d5.jpeg)

1. Your image table must have a number column. You can use the “Find Element Index” column to generate row numbers based on RowId. See: [@Darren\_Murphy](https://community.glideapps.com/t/how-do-i-create-an-auto-incrementing-row-number-with-glide-tables/39572)’s method.
2. Total Image: Use the “Roll Up” column to get the total number of images, which is useful for resetting the slideshow to the beginning.
3. JavaScript column, to calculate the current number based on the current time from Glide.

```auto
let limit = p2; // Counter limit
let currentCounter = Math.floor((new Date().getTime() / 10000) % limit) + 1;

return currentCounter;

```

 ![Screenshot 2024-05-11 at 13.39.21](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/e/de2054a7916f92575fd32b4f4198314c27896b23.png)

1. Query, to filter the Index of the image to be displayed by the row number.

 ![Screenshot 2024-05-11 at 13.29.14](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/f/afb2258ed9ded393ab117bd4d452f8383ab0ce4c.png)

1. Lookup column, to display the image to be shown by the Image component.

 ![Screenshot 2024-05-11 at 14.43.19](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/d/3de6516cde9af29d63121974cb662b9dff696b56.png)

 ![Screenshot 2024-05-11 at 13.30.15](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/2/c2e13a50d47a7c152ed6a33200750cc5dbe96dd8.png)

```auto
/*Fade-in code*/
.slideShow:has(img) > div {
  animation: fade 2.5s alternate;
}
@keyframes fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

```

## Update

* * *

After receiving feedback from @Jeff_Hager in the [CSS for Responsive Header](https://community.glideapps.com/t/css-for-responsive-header/73303/97) thread, here is the update to the JavaScript column to manipulate the duration to move 2 times faster. You need to add one more javascript column to trigger javascript now it works faster:

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/9/c9ca831cce21db9016bc96a63c64163c0eb2de34.png) ](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/9/c9ca831cce21db9016bc96a63c64163c0eb2de34.png)

```auto
function resolveAfternSeconds() {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve(new Date().getTime());
    }, 4500);
  });
}

return await resolveAfternSeconds();

```

[![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/2/32e89845fe4cc34c9b2aee72266e5cfb56ef4850.png) ](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/2/32e89845fe4cc34c9b2aee72266e5cfb56ef4850.png)

And change the above JavaScript to:

```auto
let limit = p1;
let currentCounter = Math.floor((new Date().getTime() / 5000) % limit) + 1;

return currentCounter; 

```

See also:

> **[🎞&nbsp; 2. Transforming Card Collection into a Slide-In Carousel with CSS](https://community.glideapps.com/t/2-transforming-card-collection-into-a-slide-in-carousel-with-css/73400)**  
> **[🔄&nbsp; 3. Transforming a Card Collection into a 3D Continuous Carousel with CSS](https://community.glideapps.com/t/3-transforming-a-card-collection-into-a-3d-continuous-carousel-with-css/73558)**

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 7:47am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/2 "2024-05-11T07:47:44Z")

</div>

nice. Can we also add actions to the images?

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [May 11, 2024, 7:51am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/3 "2024-05-11T07:51:39Z")

</div>

Great question. Yes, you can use a collection and filter “No is Index to show” Action following the collection method.

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 7:58am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/4 "2024-05-11T07:58:27Z")

</div>

great!! I’ll try it. 👍

I used gifs to create the illusion of a slide show but it’s a bit tedious and of course, you can’t navigate by clicking on the gif images since it’s technically one image, lol

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [May 11, 2024, 8:00am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/5 "2024-05-11T08:00:27Z")

</div>

Show if you succeed, okay… I haven’t tried it yet, but I’m confident it can be done.

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 8:03am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/6 "2024-05-11T08:03:08Z")

</div>

lol ok. I will!

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [May 11, 2024, 8:13am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/7 "2024-05-11T08:13:24Z")

</div>

Yes @Sekayi_Liburd, I’ve started it. You should use Custom Collection + Image. The result is very satisfying, each image can be clicked. Thank you for the additional idea.

 ![Screenshot 2024-05-11 at 15.11.45](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/7/77750297613c4bea7f097c680a13fac1332ec7ba.jpeg)

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 8:33am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/8 "2024-05-11T08:33:28Z")

</div>

lovely!!!

Well I was stuck from the start because i never used Row IDs or Index column before. So I’m searching for reading material 😆

The row IDs were simple but the index isn’t as intuitive.

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [May 11, 2024, 8:38am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/9 "2024-05-11T08:38:22Z")

</div>

![Screenshot 2024-05-11 at 15.35.53](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/5/85b33da9e5797cc6d08c155be22ddd05e66ffe68.png)

 ![Screenshot 2024-05-11 at 15.36.10](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/3/b333c3bd04f4a9abaeba8c8d672173346062ecc6.png)

And then: Use the math column to add: noIndex + 1

---

<div class="post-metadata">

### Author: ![nathanaelb](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nathanaelb/32/43079_2.png) [@nathanaelb](https://community.glideapps.com/u/nathanaelb)
#### Post date: [May 11, 2024, 8:49am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/10 "2024-05-11T08:49:45Z")

</div>

@Sekayi_Liburd

> [@How do I create an auto-incrementing row number with Glide Tables?](https://community.glideapps.com/t/how-do-i-create-an-auto-incrementing-row-number-with-glide-tables/39572):
>
> This is a question that comes up a lot, so creating this topic to use as a reference. Typically, there are two distinct use cases when it comes to auto-incrementing row numbers. Use Case 1: – We need to generate a Part Number, or an Order Number, or an Employee ID. Once the number is generated, it should never change, even if rows are deleted. – The general approach for this use case is to maintain a static counter, use it to craft a suitably formatted ID, and increment it by one every time…

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 8:50am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/11 "2024-05-11T08:50:29Z")

</div>

thanks!

I was also trying to figure out the rationale for the Row IDs from the contact list…

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 9:07am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/12 "2024-05-11T09:07:09Z")

</div>

> [@Himaladin](#):
>
> 1. Query, to filter the Index of the image to be displayed by the row number.
> 
> ![Screenshot 2024-05-11 at 13.29.14](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/f/afb2258ed9ded393ab117bd4d452f8383ab0ce4c.png)

Did you also have an Index to Show column in your contacts table? @Himaladin

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [May 11, 2024, 9:11am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/13 "2024-05-11T09:11:24Z")

</div>

“Index to show” is the JavaScript column you created.

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 9:13am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/14 "2024-05-11T09:13:05Z")

</div>

Yes. I was watching your source there and saw “Contacts”… Is it that your current image table is called “Contacts”?

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [May 11, 2024, 9:14am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/15 "2024-05-11T09:14:52Z")

</div>

Yes, I used a contact table to test it. Because it has an image there. You adjust it to the table where your image is located.

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 9:15am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/16 "2024-05-11T09:15:31Z")

</div>

oohhh ok! Some of the pieces are coming together now.

I originally thought you were pulling images from another table called “Contacts”

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 9:26am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/17 "2024-05-11T09:26:57Z")

</div>

Strangely enough, I got it to work automatically with the standard collection but when I used the custom collection, it became a manual slideshow…

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/1/c126543523c25e4e12d55cf183b19f220f0b0444.jpeg)

I’ll double-check to find my error…

---

<div class="post-metadata">

### Author: ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)
#### Post date: [May 11, 2024, 9:29am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/18 "2024-05-11T09:29:07Z")

</div>

It looks like you are fetching images from an array column, not a basic column.

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 9:31am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/19 "2024-05-11T09:31:24Z")

</div>

hmm… I don’t think I used an array.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/c/cc7a2f93f79cceb75ee1375a0b3f705158f19823.png)

---

<div class="post-metadata">

### Author: ![Sekayi\_Liburd](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sekayi_liburd/32/77608_2.png) [@Sekayi\_Liburd](https://community.glideapps.com/u/Sekayi_Liburd)
#### Post date: [May 11, 2024, 9:34am UTC](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271/20 "2024-05-11T09:34:11Z")

</div>

you’re right… my Image to Appear column is an array for some reason, lol.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/d/4d9de64351434e3b8b66fd74ecc2c7f01a2b7546.jpeg)

[Next page](https://community.glideapps.com/t/1-how-to-create-an-auto-play-slideshow/73271.md?page=2)
