【问题标题】:Conflict between Fancybox and other JQueryFancybox 与其他 JQuery 的冲突
【发布时间】:2012-04-28 13:51:36
【问题描述】:

我正在使用 3 个不同的 JQuery 插件来构建网站。

但是,有一个小问题。 前 2 个插件很好地协同工作,但是当我插入 Fancybox 时,其中一个插件(主要是 Fancybox,但有时是滑动登录)将被禁用,并且其行为与没有 JQuery 时一样。

<!-- PNG FIX for IE6 -->
<!-- http://24ways.org/2007/supersleight-transparent-png-in-ie6 -->
<!--[if lte IE 6]>
    <script type="text/javascript" src="js/pngfix/supersleight-min.js"></script>
<![endif]--> 
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script>
<script src="js/jquery.localscroll-min.js" type="text/javascript"></script>
<script src="js/jquery.scrollTo-min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.fancybox.js?v=2.0.6"></script>
<script type="text/javascript" src="js/jquery.mousewheel-3.0.6.pack.js"></script>

<script type="text/javascript">
$(document).ready(function () {

    $.localScroll.defaults.axis = 'x';
    $.localScroll();

    // Expand Panel
    $("#open").click(function(){
        $("div#panel").slideDown("slow");

    }); 

    // Collapse Panel
    $("#close").click(function(){
        $("div#panel").slideUp("slow"); 
    });     

    // Switch buttons from "Log In | Register" to "Close Panel" on click
    $("#toggle a").click(function () {
        $("#toggle a").toggle();
    });

    $("a.fancybox").fancybox();
});
</script>

这是链接:

<a class="fancybox" href="http://www.google.nl?id=<? echo $selectusers2['UID'] ?>" title="<? echo $selectusers2['test']." ".$selectusers2['test']." ".$selectusers2['test']; ?>"><? echo abbreviation($selectusers2['test']." ".$selectusers2['test']." ".$selectusers2['test'],17,'...'); ?></a><br />

我希望有人知道为什么会出现冲突并喜欢解决它:)

【问题讨论】:

  • 您有任何控制台错误吗?
  • 是的,“D.undelegate 不是函数”。这是 fancybox.js 中的标准规则。
  • 在 jQuery 1.3.2 中不支持取消委托 api.jquery.com/undelegate

标签: jquery slider fancybox


【解决方案1】:

Fancybox v2.x 需要 jQuery v1.6 或更高版本。升级你的 jQuery 版本

你可以用这个调用最新版本的jQuery

<script src="http://code.jquery.com/jquery-latest.js"></script>

【讨论】:

  • 谢谢,这是问题:)
猜你喜欢
  • 2010-11-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多