How To Use jQuery with MooTools

Wed, May 20, 2009

Tutorials & Tips

jQuery and MooTools are 2 great javascript frameworks that allow you to incorporate some really fancy effects on your website. I was using them while I realised that I had to use both of them on a single page at one point. I didn’t realise it then, and took me nearly an hour before I realised that the two frameworks were causing some conflicts. For me, I was trying out the accordion effect, and that caused a few compatibility issues — i.e. the javascript effects did not work at all.

<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript">
jQuery.noConflict();

(function($) {
/*whatever jQuery stuff*/
})(jQuery);
</script>

<script type="text/javascript" src="moo1.2.js"></script>
<script type="text/javascript">
window.addEvent('domready',function() {
/*whatever MooTools stuff*/
});
</script>

Done! :) By doing this and segregating your javascript effects, you can use both jQuery and MooTools together in a same page.

Similar Posts:

Share and Enjoy!

Find this information useful or entertaining? Share it to the rest of the world!
  • Digg
  • del.icio.us
  • Facebook
  • StumbleUpon
  • Technorati
  • Twitter
  • FriendFeed
  • Reddit
, , , , , , , , , ,

This post was written by:

Alvin - Alvin is a Singaporean who's interested in marketing, techy stuff and likes to just figure out how the two can work with each other. On top of his blog, you can also follow him on Twitter.

Get Alvin's Report On How To Blog Successfully - Free!

blog comments powered by Disqus