I have this code, but I don't know how to wrap it in Drupal.
$(document).scroll(function () {
var y = $(this).scrollTop();
if (y > 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.