This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center
                            
                        
                    
                
                6年前关闭。
            
        

我正在尝试安装社交sharebar 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

最佳答案

看来您有语法错误。

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

10-06 13:03
查看更多