I’m trying to use the Vivus.js script in wordpress to animate my svg logo drawing. It is loading the js file but in the error console I’m getting: SyntaxError: Unexpected token ‘<‘ referencing the first line of the virus.js file.
Here is my script from the WordPress Footer.php:
var elogo = new Vivus('elogo', {
type : 'delayed',
duration : 140,
start : 'autostart',
forceRender : true,
dashGap: 20
}, function() {
if (window.console) {
console.log('Animation finished. [log triggered from callback]');
}
})
Everything is working outside of WordPress but when I put it in my theme files it won’t execute the animation.
My page address is http://entrepology.studio-element.com
The path is wrong. Your page is linking to:
If you paste the URL in the browser it redirects to your home page. The first line of HTML is:
And this is causing the error. So all you have to do is to fix the path. Check your header.php or the functions.php (or any other place where you enqueue your script).
Edit: I tried a few other paths. This one should work (the dist is too much):