我试图使用Vivus.js脚本在wordpress动画我的svg徽标绘图。它正在加载js文件,但在我得到的错误控制台中: SyntaxError:意外令牌“<”引用了virus.js文件的第一行。
下面是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]');
}
})所有东西都是在WordPress之外工作的,但是当我把它放到主题文件中时,它就不会执行动画了。
我的页面地址是http://entrepology.studio-element.com
发布于 2015-05-11 21:40:22
这条路是错的。您的页面链接到:
<script src="http://entrepology.studio-element.com/wp-content/themes/entrepology/js/dist/vivus.js"></script>如果您将URL粘贴在浏览器中,它将重定向到您的主页。HTML的第一行是:
<!DOCTYPE html>这导致了错误。所以你所要做的就是修复这条路。检查您的header.php或functions.php (或在任何其他地方排队您的脚本)。
编辑:我尝试了一些其他的方法。这个应该有效( dist太多了):
http://entrepology.studio-element.com/wp-content/themes/entrepology/js/vivus.jshttps://stackoverflow.com/questions/30177938
复制相似问题