JQuery and Mootools conflict

I am working on a site where I have several JQuery scripts which all play nicely together. I need to add a script which uses mootools and now I am having problems due to a conflict. I have read a few articles but am totally lost as I can’t seem to get any of the noconflict suggestions to work. It may be due to my lack of understanding.

At the moment these are the JQuery scripts I am calling…


<script type='text/javascript'>
jQuery.noConflict();
jQuery(document).ready(function(){
jQuery("img.a").hover(
function() {
jQuery(this).stop().animate({"opacity": "0"}, "slow");
},
function() {
jQuery(this).stop().animate({"opacity": "1"}, "slow");
});	
});
</script>
<script type="text/javascript">
$speed = 600;
$duration = 8000;
	$(document).ready(function() {
$('blockquote').quovolver($speed, $duration);
	});
	</script>

And I want to call use this mootools script…


		<script type="text/javascript">
		    window.addEvent('domready', function(){
		        var devmenu = new deviantMenu('deviantMenu-main-conatiner');
		    });
		</script>

The mootools script works on its own, just not when it is added to the rest.

Any help or pointers would be greatly appreciated. The ideal solution would be a simpler design, but this is what the client wants :slight_smile:

Hi :slight_smile:

When you use jQuery.noConflict(), jQuery no longer uses the $ variable, so when you’re trying to call some things like $(document).ready() they will no longer work with jQuery’s $ variable.

I’d like to ask why you have the need to use Mootools and jQuery together. The menu plugin you have there looks like it’s pretty easy to replicate with jQuery (or you could have a look at some premade [URL=“http://www.filamentgroup.com/lab/jquery_ipod_style_and_flyout_menus/”]ones).

Yes, it would be much more efficient to use one library only. However, I noticed yesterday that Mootools seems to have a verion now that plays nicely with other libraries.

Has it previously not? I was under the impression that if you would for example use jQuery and Mootools together and used jQuery.noConflict(), everything should be dandy as jQuery hands the $ variable back to whatever library originally created it.

I don’t think I’ve ever actually ran into this issue as I don’t tend to mix-and-match libraries :stuck_out_tongue:

I’m not sure. But someone asked yesterday about which version of MooTools to donwload, and in comparing the versions I noticed that there was one that is so designed that it won’t cause conflicts with other libraries such as jQuery (meaning, I presume, that noConflict wouldn’t be needed). But I can’t claim to know much about this stuff. Still, if that is the case, it sounds neater than using noConflict.