带有Rapha和xEB的jQuery技能图;l如果另外两个自定义JScript也在运行,则不工作

带有Rapha和xEB的jQuery技能图;l如果另外两个自定义JScript也在运行,则不工作,jquery,runtime-error,diagram,incompatibility,Jquery,Runtime Error,Diagram,Incompatibility,我在站点上调用了以下脚本: <script src="js/jquery-1.8.1.min.js"></script> <script src="js/bootstrap.js"></script> <script src="js/scripts.js"></script> <script defer src="js/jquery.flexslider-min.js" ></script> <

我在站点上调用了以下脚本:

<script src="js/jquery-1.8.1.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/scripts.js"></script>
<script defer src="js/jquery.flexslider-min.js" ></script>
<script src="js/jquery.carouFredSel-6.1.0-packed.js" ></script>
<script src="js/modernizr.html"></script>
<script src="js/jquery.prettyPhoto.js"></script>
<script src="js/main.js"></script>
<script src="js/jquery.isotope.min.js"></script>
<script src="js/jquery.gmap.js"></script>
<script src="js/skrollr.min.js"></script>
<script src="js/raphael.js" type="text/javascript"></script>
<script src="js/init.js" type="text/javascript"></script>

raphael.js和init.js建立了一个技能图()。问题是,除非我同时禁用scripts.js和main.js(它们都是自定义脚本,我将它们包括在“不工作”中),否则该图无法工作

如果我把raphael.js和init.js放在另外两个之上,那么这个图就部分构建好了。因此,很明显,其他两个脚本(因为如果我省略其中一个脚本,则不会发生任何更改)一起导致在两个脚本(raphael.js和init.js)中的一个或另一个脚本中没有发生或发生错误

我一直在试图找出scripts.js和main.js中到底发生了什么,可能导致raphael.js或init.js失败。也许有人能弄明白,因为这对我来说是个谜

正常工作:,没有这些有问题的脚本的正常图表工作正常。


不工作:,我包括script.js和main.js脚本,瞧,图表不再工作了:它消失了好的!找到了答案!耶

嗯,我知道如何修理它,但不知道为什么它一开始就坏了。虽然我想我包含的脚本之一是设置一些东西,使jQuery函数不能仅仅由
$(…)…
引入,而是需要在
jQuery.noConflict()(function($){…}
)中。因此,为了实现这一点,我必须使用上面的调用将这些代码片段包装在init.js中:

jQuery.noConflict()(function ($) {
  $('.get').find('.arc').each(function (i) {
    var t = $(this),
      color = t.find('.color').val(),
      value = t.find('.percent').val(),
      text = t.find('.text').text();

    rad += 30;
    var z = r.path().attr({
      arc: [value, color, rad],
      'stroke-width': 26
    });

    z.mouseover(function () {
      this.animate({
        'stroke-width': 50,
        opacity: .75
      }, 1000, 'elastic');
      if (Raphael.type != 'VML') //solves IE problem
        this.toFront();
      title.stop().animate({
        opacity: 0
      }, speed, '>', function () {
        this.attr({
          text: text + '\n' + value + '%'
        }).animate({
          opacity: 1
        }, speed, '<');
      });
    }).mouseout(function () {
      this.stop().animate({
        'stroke-width': 26,
        opacity: 1
      }, speed * 4, 'elastic');
      title.stop().animate({
        opacity: 0
      }, speed, '>', function () {
        title.attr({
          text: defaultText
        }).animate({
          opacity: 1
        }, speed, '<');
      });
    });
  });
});
如果有人知道如何解释原因,那么欢迎您补充这个答案并进一步教育我们

jQuery.noConflict()(function($){
  $(function(){ o.init(); });
});