Sorry to say, you are going to want to take the time to a) fix the old plugin to work on newer versions of jQuery yourself, or b) switch to a carousel that works with the new versions of jQuery. Including two versions of jQuery on a site is bad practice, and you will be asking for trouble later, but it is not impossible.
You may be able to do something like this:
<script type="text/javascript" src="/js/jquery-1.2.1.js"></script>
<script type="text/javascript" src="/js/oldcarousel.js"></script>
<script type="text/javascript">jQuery12 = jQuery.noConflict();</script>
<script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
Assuming that oldcarousel.js
uses the closure (meaning the first and last lines of code look like this):
(function($){
// and that all plugin code in here references $ not jQuery
})(jQuery);
It should be able to "hang on" to jQuery 1.2 after 1.4 overwrites it.
It might also work to change the include order:
You may be able to do something like this:
<script type="text/javascript" src="/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/js/jquery-1.2.1.js"></script>
<script type="text/javascript" src="/js/oldcarousel.js"></script>
<script type="text/javascript">jQuery12 = jQuery.noConflict(true);</script>
As passing true
to .noConflict()
should restore the $
and jQuery
aliases from the new version.