0

我正在尝试安装一个社交分享栏 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.movi​​epostersdb.com <--- 网站的 URL。

4

2 回答 2

5

看起来您有语法错误。

$('#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
    });
});
于 2013-05-21T22:08:50.507 回答
0

它应该是:

$(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
 });
});

所以$('#social-share').dcSocialShare();是错误的关闭

于 2013-05-21T22:11:09.797 回答