I am using two jQuery scripts. One is for controlling the drop down navigation on a site and the other is for a slideshow.
The one module is preceded with this code:
jQuery.noConflict();
(function($){
$.fn.dropmenu = function(custom)
The other one starts like this:
$(document).ready(function() {
As a result all of the functions in the second one show up as “not a function”
Since both of the scripts I am using are jQuery it seems that I should be able to get rid of the NoConflict function and these two scripts would play nicely together.
Sage advice welcome.
usually
$()is the same asjQuery().noConflict ‘frees’ the $ from jquery so it can be used by other libraries.
So you could just be using
jQueryinstead of$everywhere.Or you could do it like they show in their examples and pass
jQueryinto an anonymous function inside which you can use$again as usual:So the problem in your example is that the first plugin calls noConflict() so $ can’t be used by the second plugin.
You could solve it by putting everything thats inside
$(document).ready()inside(function($){.Or you get rid of
noConflictaltogether if you don’t need it (if you’re not using any other library that uses$).