# Carousel in jekyll web site not working

**URL:** <https://talk.jekyllrb.com/t/carousel-in-jekyll-web-site-not-working/9148>\
**Category:** Uncategorized\
**Created:** [May 4, 2024, 8:36am UTC](https://talk.jekyllrb.com/t/carousel-in-jekyll-web-site-not-working/9148 "2024-05-04T08:36:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![singhaidotnish](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/singhaidotnish/32/5911_2.png) [@singhaidotnish](https://talk.jekyllrb.com/u/singhaidotnish)\
**Post date:** [May 4, 2024, 8:36am UTC](https://talk.jekyllrb.com/t/carousel-in-jekyll-web-site-not-working/9148/1 "2024-05-04T08:36:24Z")

</div>

I am from python background, relatively new to jekyll. So i have to show a carousel of images on this site. Found [this](https://jekyllcodex.org/without-plugin/slider/) for reference. As the page suggests I have put things in place or so it seems to me. CMIIAW.

This gives error without loading anything on the page. Please help with explaining or suggesting links on how it work plus a solution. Thank you

error:

```auto
Uncaught TypeError: elements[j] is undefined
    <anonymous> https://singhaidotnish.github.io/zarir-ka-website/:352

```

github link : [zarir-ka-website](https://github.com/singhaidotnish/zarir-ka-website.git)

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [May 6, 2024, 4:44pm UTC](https://talk.jekyllrb.com/t/carousel-in-jekyll-web-site-not-working/9148/2 "2024-05-06T16:44:41Z")

</div>

can you give a little more info? like which page is the slider on?

is there a link to the live site showing it not working?

---

<div class="post-metadata">

**Author:** ![singhaidotnish](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/singhaidotnish/32/5911_2.png) [@singhaidotnish](https://talk.jekyllrb.com/u/singhaidotnish)\
**Post date:** [May 7, 2024, 10:21am UTC](https://talk.jekyllrb.com/t/carousel-in-jekyll-web-site-not-working/9148/3 "2024-05-07T10:21:49Z")

</div>

site link : [Awesome Title](https://singhaidotnish.github.io/zarir-ka-website/)

 ![Screenshot from 2024-05-07 15-49-53](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/8/8be4cca75fa7191e776d47f056ce77681e8362e5.png)

github repository : [GitHub - singhaidotnish/zarir-ka-website: Agency Theme for Jekyll](https://github.com/singhaidotnish/zarir-ka-website)

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [May 7, 2024, 3:50pm UTC](https://talk.jekyllrb.com/t/carousel-in-jekyll-web-site-not-working/9148/4 "2024-05-07T15:50:08Z")

</div>

the console is showing a 404 for all of your files like js and css - this is because you have the baseurl set wrong.

You have: `baseurl: /agency-jekyll-theme/`

it should be: `baseurl: /zarir-ka-website`

notice the wrong one also has a trailing slash that needs to be removed.

---

<div class="post-metadata">

**Author:** ![singhaidotnish](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/singhaidotnish/32/5911_2.png) [@singhaidotnish](https://talk.jekyllrb.com/u/singhaidotnish)\
**Post date:** [May 8, 2024, 9:43am UTC](https://talk.jekyllrb.com/t/carousel-in-jekyll-web-site-not-working/9148/5 "2024-05-08T09:43:10Z")

</div>

Thank you for your reply. Carousel is not showing any image yet.

`var elements = document.querySelectorAll('#carousel0 .carousel__control--forward');`

It should not be returning a blank, CMIIAW.

What am i missing here ?

EDIT:  
When i click on error in console, what comes is,

`ERROR: Uncaught TypeError: elements[j] is undefined`

Thank you

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [May 8, 2024, 3:12pm UTC](https://talk.jekyllrb.com/t/carousel-in-jekyll-web-site-not-working/9148/6 "2024-05-08T15:12:17Z")

</div>

I’m not familiar with that carousel but the person who made it has been very helpful to others who had issues - try asking a question on the repo for it.
