我正在尝试安装社交共享栏 jquery 脚本。但由于某种原因,它没有加载,我似乎找不到原因。
在网站的头部,我加载了 jquery 以及 jquery 脚本,就像它声明的那样:
<script type="text/javascript" src="http://www.moviepostersdb.com/js/jquery.min.js"></script>
<script type="text/javascript" src="http://www.moviepostersdb.com/js/jquery.social.share.2.2.js"></script>
脚本安装还要求将一些额外的脚本放入头部:
<script type='text/javascript'>
$(document).ready(function($){
$('#social-share').dcSocialShare();
size: 'horizontal',
location: 'bottom',
offsetAlign: 0,
offsetLocation: 0,
buttons: 'twitter,facebook,linkedin,digg,stumbleupon,delicious,pinterest,xing,buffer,print,email',
floater: false,
autoClose: true
});
});
</script>
这也将被实现。
在正文结束标记之前,安装还要求执行以下代码...同样,我也这样做了:
<div id="social-share"></div>
尽管如此,由于某种原因......社交侧边栏没有显示在网站上。谁能看出可能出了什么问题吗?
www.moviepostersdb.com <--- 网站 URL。
最佳答案
您似乎有语法错误。
$('#social-share').dcSocialShare();
^-- closed here
我想你的意思是:
$(function(){
$('#social-share').dcSocialShare({
size: 'horizontal',
location: 'bottom',
offsetAlign: 0,
offsetLocation: 0,
buttons: 'twitter,facebook,linkedin,digg,stumbleupon,delicious,pinterest,xing,buffer,print,email',
floater: false,
autoClose: true
});
});
关于javascript - 为什么这个脚本没有启动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16680306/