jQuery在Blogger小部件上发生冲突

时间:2013-08-16 03:08:29

标签: blogger jquery

嗨,我对此非常陌生,请原谅我的愚蠢行为。

最近我尝试安装响应式博客菜单,这是代码

<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js'></script> <script type='text/javascript'> // <![CDATA[ $(function() { var offset = $("#FloatingSocialButtons").offset(); var topPadding = 15; $(window).scroll(function() { if ($(window).scrollTop() > offset.top) { $("#FloatingSocialButtons").stop().animate({ marginTop: $(window).scrollTop() - offset.top + topPadding }); } else { $("#FloatingSocialButtons").stop().animate({ marginTop: 0 }); }; }); }); // ]]> </script> <style> #FloatingSocialButtons { position: absolute; left: -100px;  background-color: #F2F2F2; border: 1px solid #D8D8D8; border-right: 0; z-index:9; border-radius:10px; -moz-border-radius: 10px; } #FloatingSocialButtons div { margin: 5px 0 0 0; } </style>   <div id='FloatingSocialButtons'> <center> <div style='margin:0px 0 0px 10px;'><div id='fb-root'></div><script src='http://connect.facebook.net/en_US/all.js#xfbml=1'></script><fb:like font='' href='' layout='box_count' send='false' show_faces='false'></fb:like></div> <div><a class='twitter-share-button' data-count='vertical' data-lang='en' href='http://twitter.com/share'>Tweet</a><script src='http://platform.twitter.com/widgets.js' type='text/javascript'></script></div> <div><script src='http://apis.google.com/js/plusone.js' type='text/javascript'></script><g:plusone size='tall'></g:plusone></div> <div style='margin-top: 15px;'><a data-pin-config='vertical' data-pin-do='buttonPin' href='http://pinterest.com/pin/create/button/?url='data:post.url' '><img src='//assets.pinterest.com/images/pidgets/pin_it_button.png'/></a> <span style='margin-left:-44px;'><a data-pin-config='vertical' data-pin-do='buttonBookmark' href='//pinterest.com/pin/create/button/' style='outline:none;border:none;'></a></span> <script src='http://assets.pinterest.com/js/pinit.js' type='text/javascript'></script></div> <br /> <p style=' line-height:0px; font-size:10px; font-weight:bold; text-align:center;'><a href='www.tipstricksisland.com/2013/05/new-smooth-floating-social-bookmarking-blogger-2013.html' style='color:#CAC8C8;'>Get This</a></p> </center></div>

它不起作用,当我问作者他说我有jquery冲突问题,但无法帮助我。我不知道该怎么做。请查看我的博客并告诉我导致问题的小部件http://dota2android.blogspot.com

感谢您的时间

1 个答案:

答案 0 :(得分:0)

如果您遇到jQuery Conflict问题,则应该是using jQuery in NoConflict Mode

这意味着如果某个库或对象已声明使用jQuery的$关键字,它仍会按预期执行。

 $.noConflict();
jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
});
    // Code that uses other library's $ can follow here.