I’ve been trying to include a small JS code snippet in a page on my website using the content JS function in Cornerstone, and bizarrely, the code works as intended within Cornerstone, but not once I view the page on the site. I’ve tried a couple hours of troubleshooting to no avail: I’ve cleared my browser cache and website cache, turned every plugin off and on again (the only plugins I have installed are the ones that came with X Theme, Yoast, Duplicate Post, and Smush), the browser console isn’t throwing any errors, and the code is appearing in the page source correctly. I also tried putting the code in an external .js file and enqueueing it in functions.php, but no luck there either.
Here’s the page on my site. What should be happening is that some of the fruits in the image spin as you scroll up and down the page. For now, they appear static.
Here’s my javascript code. This code needs 2 jquery scripts to run correctly (also pasted those in the pastebin for reference), but they seem to have been successfully enqueued. The only code that I implemented with the JS tool in Cornerstone was the contents of the 3rd script tag.
Any ideas? Happy to provide more details if you need them.
Thanks much in advance!