3 Replies - 960 Views - Last Post: 25 January 2010 - 03:54 PM

#1 ptamzz  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 103
  • Joined: 04-March 09

Help using jQuery & Mootool together

Posted 25 January 2010 - 03:07 PM

I want to use jQuery & Mootool together on a page.

<script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script> 
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js"></script>


after this i've to load some more js files for jQuery

<script src="js/jquery.easing.1.3.js" type="text/javascript"></script>
	<script src="animated-menu.js" type="text/javascript"></script>


and for mootool

<script type="text/javascript" src="js/overlay.js"></script>
	<script type="text/javascript" src="js/assets.js"></script>
	<script type="text/javascript" src="js/multibox.js"></script>



Since using both jQuery & mootool doesnt work, I've checked some websites and it tells me to add a jQuery.noConflict() function to eliminate possible conflicts after all the libraries are loaded.

Can anyone help me out solve this problem.. like which part of the code to add the jQuery.noConflict() etc.

This post has been edited by ptamzz: 25 January 2010 - 03:10 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Help using jQuery & Mootool together

#2 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Help using jQuery & Mootool together

Posted 25 January 2010 - 03:26 PM

Inside the block of javascript code that you write, use noConflict, like so:
var $j = jQuery.noConflict();
// from now on, use $j('.foo') instead of $('.foo')


Was This Post Helpful? 0
  • +
  • -

#3 ptamzz  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 103
  • Joined: 04-March 09

Re: Help using jQuery & Mootool together

Posted 25 January 2010 - 03:40 PM

that means i replace all the $'s in the jQuery files with $j??
Was This Post Helpful? 0
  • +
  • -

#4 girasquid  Icon User is offline

  • Barbarbar
  • member icon

Reputation: 108
  • View blog
  • Posts: 1,825
  • Joined: 03-October 06

Re: Help using jQuery & Mootool together

Posted 25 January 2010 - 03:54 PM

No - just the code that you write. Because plugins are (generally) written using the jQuery object instead of $, you should still be able to use them just fine.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1