views:

85

answers:

2

I am using this javascript menu which i bought on the net called SmoothMenu and it works fine in a standalone page..but when incorporated with a master page that is using other javascript files as well it does not load the javascript which applies the css properties.

I am using mootools javascript file "mootools-1.2.1-core-nc.js" and there is a block of code like

<script type="text/javascript">
    window.addEvent('domready', function() {
        var mySmoothMenu = new SmoothMenu("navigation");
    });
</script>

in the head section , which actually applies some stylesheet to my div with id="navigation" but looking the source with firebug it results that there is some problem with it as no stylesheet is applied at all. Am I missing some problem here, is there any issue with mootools and jquery???? is there any trick to be added to the above line???

It is really important and any suggestion kindly appreciated.

Edited : In fact I currently discovered that i was using some other version of mootools file for another component and after removing the older one it seems to work but I am still trying to fix things here. I think the two mootools use same behavior and cause ambiguity so the result is total conflict.

+2  A: 

Both mootools and jQuery declare a function called $, so they are incompatible out of the box - basically they overwrite each other.


Try this


Or, better, don't use jQuery; if smoothmenu depends on mootools just use mootools

Kaze no Koe
I agree. 1 library > 2 libraries
Justin Johnson
I have no choice i have to use both of them. I tried your first link, thanks by the way,but eventually i am not using $ signvar mySmoothMenu = new SmoothMenu("divid"); in this line if a try to change it to var mySmoothMenu = new SmoothMenu($("navigation"));or $$ it doesn't work at all...
Izabela
A: 

MooTools and jQuery can work together when using MooTools, version 1.2.3 and higher.

Oskar Krawczyk
I am using mootools-1.2.1-core-nc.js so it is an older version I guess ?
Izabela
Indeed. You can read more about it, in this blog post: http://mootools.net/blog/2009/06/22/the-dollar-safe-mode/
Oskar Krawczyk