Working together with MooTools & jQuery: Revisited

Approximately a year ago, while I was starting to work with WordPress and trying out different plugins, I had encountered problems trying to integrate plugins that used MooTools and plugins that use jQuery. I had posted a possible solution in there as well. Here are solutions from jQuery site, if you want to know more.

So, after a year with playing around a lot of plugins that uses mootools / scriptaculous and other plugins that uses jQuery (which I prefer), I want to share one easy solution that I have found. I haven’t had any problems till now with this solution and I have been using and recommending to to all my themes.

You do not have to define and noConflict function as recommended by jQuery site. Simply, refrain from using $ as a shortcut to jQuery which means that you have to use jQuery in place of all $ used by your jQuery code. So, your code will look something like this:

jQuery(document).ready(function(){
   jQuery("div").hide();
});

I know its a bit tedious but it works well without having to take all the headaches of what is happening. So, while your jQuery plugin work perfectly, you can enjoy the features from other plugins using MooTools or other libraries.

Happy Thanksgiving to all. Once again, I would like to personally thank everyone for being a part of WPshoppe.

:o

2 thoughts on “Working together with MooTools & jQuery: Revisited

  1. Just poking my head in to say hello. I have just started playing around with ‘cleanr’ and I like it. However, although the design itself is very clean, the actual code is totally opaque and unmaintainable.

    I mean, the main style sheet that defines the page layout is called ’960.css’ (why?) and consists of a SINGLE LINE, with no comments. The styles are called things like ‘grid_11′, ‘container_16′, ‘suffix_4′, and other totally unhelpful names.

    All I wanted to do was expand the main column so that it was wide enough to take 1024×760 photos. After an hour and a half of poking at it, it looks like if I want to do that I’m going to need to choose another theme.

    • Hello Fred,

      This theme is using what is called a CSS Framework called 960.gs. This is to make things easy on the theme development part. I understand your frustration which I have gone through even after being a developer. But I have to say that if you want to change the width, it will be next to impossible using this framework. Since, this is a fixed width design and the widths are hardcoded on the css framework. 960 is used because its a quite popular and acceptable width rather than 1024. If you want to know more please visit http://960.gs.

      Thanks,
      Chandra