From the error you get I see that the $
is being used by Mootools.
Use jQuery
instead of $
and you should be fine. So try this:
jQuery.noConflict();
jQuery(window).scroll(function() {
jQuery('#menu1').toggle(jQuery(this).scrollTop() > 350);
});
You could also do it with MooTools:
window.addEvent('scroll', function () {
var scroll = window.getScroll().y;
scroll > 350 ? $('menu1').show() : $('menu1').hide();
});
Anyway, keep in mind MooTools uses the dollar sign to get a element by ID ($('myID')
), you can also use this instead: document.id('myID')
, they are the same.