Hi,
I’m new to coding and Webflow, so this query is probably an easy one to solve. I’m trying to add custom Javascript to my project. I have a Div called slides, with a tag and an ID. I’m testing to see if my Javascript is even working:
Does anyone know what I’m forgetting or doing wrong?
Thank you for your help.
Here is my site Read-Only: LINK
(how to share your site Read-Only link )
Stan
(justAnotherDeveloper)
July 12, 2021, 9:00pm
2
hi @slowandsteady and welcome. It is hard to say when I can’t see what is inside slides
. Is it just single div
? if yes you code should be
const slides = document.querySelector(".slides")
if you try to point all elements with class slides
inside div
const slides = document.querySelectorAll(".slides")
Hi! Thanks for your help. That still didn’t solve my issue.
“slides” has 4 images inside of a div. like this:
This script is working in visual studio, but it’s not working in Webflow. I think I’m doing something wrong setting up inside of the Webflow platform. I’m just putting the script in the Before tag section of the page settings. Do I need to something additionally?
Stan
(justAnotherDeveloper)
July 12, 2021, 9:11pm
4
can you send Read only link to project?
I’m trying to get an alert message when the image is clicked on.
Stan
(justAnotherDeveloper)
July 12, 2021, 9:39pm
7
hi @slowandsteady what page it is as I can’t find section that is on image?
edit: found it on Project 3
I should read text to end
Smith.S
(: ))
July 12, 2021, 9:52pm
8
Webflow section is created with div, not section tag.
That why your selector “section div.slides” is not working.
change section tag to … section
or change your selector to “.slides” or anything.
Stan
(justAnotherDeveloper)
July 12, 2021, 10:01pm
9
hi @slowandsteady here is short video how to feel free to download it as I will delete it when cleaning my Cloud space later.
https://cln.sh/CjNcdG
Thank you so much for your help! I appreciate it so much!
Stan
(justAnotherDeveloper)
July 13, 2021, 3:02pm
11
hi @slowandsteady if your issue doesn’t persist feel free to close your request as solved