nahid
nahid

Reputation: 37

How to resolve the conflict between jquery and mootools 1.11?

the slide show in my page stops working when I add the mootools script. How to resolve that?

    <!--Script-->
<script type='text/javascript' src="js/jquery.1.3.2.js"></script>
<script type='text/javascript' src='js/jquery.cycle.all.min.js'></script>
<script type='text/javascript' src='js/presentationCycle.js'></script>

<!--mootools for dropdown-->
<script type="text/javascript" src="js/mootools.js"></script>
<script type="text/javascript" src="js/elSelect.js"></script>



<script type="text/javascript">
<!---//
window.addEvent('domready', function(){
var mySelect = new elSelect( {container : 'mySelect'} );

var mySelect2 = new elSelect( {container : 'mySelect2'} );

var mySelect3 = new elSelect( {container : 'mySelect3'} );

var mySelect4 = new elSelect( {container : 'mySelect4'} );
});
//-->
</script>

Upvotes: 0

Views: 1578

Answers (1)

Jacek Kaniuk
Jacek Kaniuk

Reputation: 5229

presentationCycle.js is badly written - it uses $ instead of jQuery (and $ is used also by mootools)

You have to enclose presentationCycle in:

(function($) {
    ...
})(jQuery);

apart from that, read:

http://api.jquery.com/jQuery.noConflict/

Upvotes: 1

Related Questions