jQuery code in Drupal I have this code, but I don't know how to wrap it in Drupal. 

 $(document).scroll(function () {
    var y = $(this).scrollTop();
    if (y &gt; 100) {
        $('.bottomMenu').fadeIn();
    } else {
        $('.bottomMenu').fadeOut();
    }

});


I've already activated the .js file and added the detail in .info, I can see it from the firebug that is ok, but from firebug console I can see that I have syntax errors.

From Drupal website I can see an example:

(function ($) { // Here code javascript })(jQuery);


Can someone show me how the code above should look like into Drupal? Thanks.
Here you go:

(function($) { 
  Drupal.behaviors.yourCustomName = {
    attach: function (context, settings) {

      $(document, context).scroll(function () {
        var y = $(this).scrollTop();
        if (y &gt; 100) {
          $('.bottomMenu').fadeIn();
        } else {
          $('.bottomMenu').fadeOut();
        }
      });

    }
  };
})(jQuery);


Be sure to read the docs.