I think the problem is that if you add your script to the module.js it (HubSpot) will wrap the function within a function. This will break your code returning an error on the plusSlides function.
You can see the error on the console log clicking on the arrows at this pen.
Also I did see your arrows are going the wrong way, so in the example I changed the -1 and 1 for prev and next.
You can do two things:
- Change your code and make sure it will run on a document ready (DOMContentLoaded event)
- Or embed your javascript code into your HTML wrapping it within <script> tags
@DMaksimovic you can find enough examples on codepen or the internet if you look for this kind of functionality.
I think the problem is that if you add your script to the module.js it (HubSpot) will wrap the function within a function. This will break your code returning an error on the plusSlides function.
You can see the error on the console log clicking on the arrows at this pen.
Also I did see your arrows are going the wrong way, so in the example I changed the -1 and 1 for prev and next.
You can do two things:
- Change your code and make sure it will run on a document ready (DOMContentLoaded event)
- Or embed your javascript code into your HTML wrapping it within <script> tags
@DMaksimovic you can find enough examples on codepen or the internet if you look for this kind of functionality.