如何阻止jquery彼此冲突?

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

标签: jquery

我在我的网站上使用了两个单独的jquery即时消息,我们将它们都放在标题中。

基本上jquery 1与jquery 2冲突.jquery 2是一个jquery图像滑块,当我在头jquery 1中有两段代码一起阻止jquery 2一起显示时,是否有一种方法可以阻止这场冲突?感谢。

JQUERY 1

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script src="assets/js/scroll/jquery.mousewheel.min.js"></script>
<script src="assets/js/scroll/jquery.mCustomScrollbar.js"></script>

<script>
    (function($){
        $(window).load(function(){
            $(".nswp-frame").mCustomScrollbar();
        });
    })(jQuery);
</script>

JQUERY 2:

<?php if ($page_title == "Home") {  ?>
 <script type="text/javascript" src="assets/js/js_photos/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="assets/js/js_photos/jquery.mousewheel.js"></script>
<script type="text/javascript" src="assets/js/js_photos/jquery.gridnav.js"></script>



<script type="text/javascript">
            $(function() {
                $('#tj_container').gridnav({
                    type    : {
                        mode        : 'seqfade',    // use def | fade | seqfade | updown | sequpdown | showhide | disperse | rows
                        speed       : 500,          // for fade, seqfade, updown, sequpdown, showhide, disperse, rows
                        easing      : '',           // for fade, seqfade, updown, sequpdown, showhide, disperse, rows   
                        factor      : 100,          // for seqfade, sequpdown, rows
                        reverse     : ''            // for sequpdown
                    }
                });
            });
        </script>
     <? } ?>    

0 个答案:

没有答案