That's because jQuery load mootool aswell, it use $
as initialisation. Since mootool is loaded after jQuery, $ === Mootool
.
That's why when you load by hand the google lib, it work. It override the $
symbole with jQuery.
Make a closure and your script will work :
(function($){ // FUnction that accept an argument.
$(window).load(function(){
//close drop down by default
$('.nav-child').hide();
//handle drop down parent click
$('.parent').click( function(event){
event.stopPropagation();
$(this).find('.nav-child').slideToggle();
$(this).addClass("active");
});
//hide drop down when user clicks anywhere outside of drop down
$(document).click( function(){
$('.nav-child').hide();
$("li.active").removeClass("active");
});
});
})(jQuery) //Sending jQuery to that function