【问题标题】:No Conflict causing issues with other jquery没有冲突导致与其他 jquery 的问题
【发布时间】:2014-07-29 09:40:36
【问题描述】:

所以我几天前发布了试图获得帮助以了解如何实现无冲突。感谢@tdanielcox 帮助我。我正确地实现了它,但它似乎导致灯箱出现问题,该灯箱在实现无冲突之前正常工作。

这里是没有使用冲突的页面。

http://michaelcullenbenson.com/MichaelCullenBenson.com/index2.html

灯箱处于每张图片的悬停状态,点击放大镜。

此页面是在实施无冲突之前,并且有一个正常运行的灯箱版本,但底部的 dribbble feed 中断,没有冲突。

http://michaelcullenbenson.com/MichaelCullenBenson.com/index.html

如果我删除 jquery 1.6.1,灯箱将继续相应地再次运行。唯一适用于灯箱的 jquery 文件是 (jquery.magnific-popup.js) 但不需要 1.6.1 jquery 库,所以我很困惑为什么它会影响它。

这里是与 jquery 没有冲突的标记。非常感谢您的帮助!不知道我有多感激。

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>


        <script type="text/javascript" src="js/jquery.innerfade.js"></script>


        <script type="text/javascript">
       $(document).ready(
                function(){
                    $('#news').innerfade({
                        animationtype: 'slide',
                        speed: 600,
                        timeout: 6000,
                        type: 'random',
                        containerheight: '1em'
                    });


            });
    </script>

        <!-- Include all compiled plugins (below), or include individual files as needed -->
        <script src="utilcarousel-files/utilcarousel/jquery.utilcarousel.min.js"></script>
        <script src="utilcarousel-files/magnific-popup/jquery.magnific-popup.js"></script>
        <script src="js/responsive-nav.js"></script>





        <script>
            $(function() {


                $('#fullwidth').utilCarousel({
                    breakPoints : [[600, 1], [800, 2], [1000, 3], [1300, 4],],
                    mouseWheel : false,
                    rewind : true,
                    autoPlay : true,
                    pagination : false
                });

                $('#fullwidth2').utilCarousel({
                    breakPoints : [[600, 1], [800, 2], [1000, 3], [1300, 4],],
                    mouseWheel : false,
                    rewind : true,
                    autoPlay : true,
                    pagination : false
                });

            });
        </script>

   < script >     
        $(document).ready(function() {
var movementStrength = 25;
var height = movementStrength / $(window).height();
var width = movementStrength / $(window).width();
$("#aboutarea").mousemove(function(e){
          var pageX = e.pageX - ($(window).width() / 2);
          var pageY = e.pageY - ($(window).height() / 2);
          var newvalueX = width * pageX * -1 - 25;
          var newvalueY = height * pageY * -1 - 50;
          $('#aboutarea').css("background-position", newvalueX+"px     "+newvalueY+"px");
});
});

    </script>

  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
  <script>var $j6 = jQuery.noConflict();</script>

    <script type="text/javascript" src="dribbble.js"></script>  
    <script type="text/javascript">

    $j6(function () {

        $j6('#user').dribbble({
            player: 'MCBDesign', 
            total: 1
        }); 
    });

    </script>

【问题讨论】:

    标签: javascript jquery html lightbox conflict


    【解决方案1】:

    你试过var $j6 = jQuery.noConflict(true);吗?

    【讨论】:

    • 如果我想做的只是添加 (true) 然后就这样做了,它基本上破坏了包括运球提要在内的所有内容。
    猜你喜欢
    • 2013-07-11
    • 2010-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-12
    • 1970-01-01
    相关资源
    最近更新 更多