1

I have a slider and a navigation bar, both requires the use of different jquery version.

The slider uses 1.7.2 while the navigation uses 1.4.2

    <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>


    <script type="text/javascript" src="js/jquery-1.4.2.js"></script>
    <script type="text/javascript">
    var $jq = $.noConflict(true);
    </script>

<!-- NAVIGATION -->
    <script type="text/javascript">
    $jq(document).ready(function() {
        $jq('#main-image-box').children().removeClass('facets').end().facets({
            control: 'ul#mainlevel',
            clipSpacing: 1,
            animationSpeed: 400,
            beforeMax: function(index) {
                $('#main-image-box .clip:eq('+index+') .container').show();
            },
            beforeMin: function(index) {
                $('#main-image-box .clip:eq('+index+') .container').hide();
            }
        });
    });
    </script>

<!-- SLIDER -->
    <script type="text/javascript" src="js/jquery.nivo.slider.js"></script>
        <script type="text/javascript">

       (window).load(function(){
            ('#slider').nivoSlider();
        });
        </script>

As you can see, I have tried using noconflict but it doesn't work, how do I solve this problem?

3
  • possible duplicate of Using two jQuery libraries 1.7.1.js and 1.5.2.js on a facebook app Commented Sep 13, 2012 at 0:26
  • In you navigation code you use both $jq and $, in the slider code you forget the $ Commented Sep 13, 2012 at 0:26
  • This is why you should learn to write jquery instead of relying on plugins. And if you are going to rely on plugins pick ones under active development. Commented Sep 13, 2012 at 1:07

2 Answers 2

2

Does the navigation require 1.4.2?? I'd be surprised if it did.

So just get rid of that older version, and try it out.

Sign up to request clarification or add additional context in comments.

1 Comment

More a comment than an answer.
0
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script>
var $jVersion7 = $.noConflict(true);
</script>

<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type="text/javascript">
var $jVersion4 = $.noConflict(true);
</script>

Note that, if the navigation plugin you use MUST use jQuery 1.4.2 ONLY, it will be a good idea to choose a new plugin and dispose the old version.

jQuery has lots of plugins.

7 Comments

It works even if I use the 1.72 but if I uses on IE, navigation seems to be buggy.
@user1631889. so go get yourself a new plugin. this is what I would do. in the meanwhile, my code above should do the job.
I wishes to get a new plugin, but due to company requirements, I can't get new plugin. Is there any alternatives?
@user1631889. Yes! MY ANSWER... :)
@user1631889. Dude! are you real? my code in the answer does what you want! it will give you two different jQuery versions instances.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.