@hugosmith
Your script is looking for elements with a class name of calendlybutton which none exist. You do have an element with the ID of calendlyButton. If you are using classnames then add the class to your element and pay attention to case.
var calendyButton = document.getElementsByClassName('calendlybutton');
You also need to change the url to your calendly profile, not some other user.
Your implementation is wrong. Your target elements are using the same ID not classnames for one. If you need implementation help I am available for freelance work.
As @webdev said, I was using the button ID instead of a class . I also tried to put the listener in the site-wide . Don’t ask me why, but for some reason moving it to an embed in the navbar fixed my problem.
I’m having some trouble embedding Calendly and was hoping I could get some help.
Here is what I want to do.
All carousel buttons when clicked open the Calendly pop-up
Footer buttons on each page, when clicked open the Calendly pop-up
Initially, I used the [getElementById] script provided by Jeff S, and the one carousel button on the initial slide worked. I could not get the footer button to work at all.
But since I want all the buttons on the slider to launch the Calendly pop-up, I switched it to the [getElementsByClassName], and everything stopped working.
Here are the details.
I added the following code to the page’s body code section:
For the footer buttons, I did not add the first two link widget code snippets, because I figured they’re already there. And the footer buttons have a combo class, but I only used the initial class.
So that’s my story. Can anyone figure out why things aren’t working for me?
Here is my Read Only Link.
Hi @webdev, I’ve followed your solution and it works as intended, except the popup displays a menu with supposedly all of my appointment types (of which I only have one), so clients need to click on the appointment type before accessing the calendar itself. Is there a way to display the calendar straight away, and to bypass the step of showing the appointment types first?
I am now trying to display the same button on two other pages, but when I copy everything over to these other pages, the button doesn’t work. Am I missing something?
Your issue is probably related to the use of ID as the selector. Only one element on a page can share the same name. Refactor your script to use classes and loop through the results.