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
jQuery(function($) { });wp_register_scriptandwp_enqueue_script, or are you just adding a script tag into your page template? Loading JS files in WordPress should always be done with the former. Read more here: Properly add scripts in WordPress themes