How to get Fixed Navigation when scrolling to the top I am using this module Single Page Site to get a single page and it works well.  However I want to get the navbar fixed when scrolling up the page but I cannot figure out how and where to put this jquery code in my site. 

$(document).ready(function () {

  var navbar = $('.navbar');
  var origOffsetY = navbar.offset().top;

  function scroll() {
     if ($(window).scrollTop() &gt;= origOffsetY) {
         $('.navbar').addClass('.navbar-fixed-top');
         $('.main-container').addClass('menu-padding');
     }
     else {
        $('.navbar').removeClass('.navbar-fixed-top');
        $('.main-container').removeClass('menu-padding');
     }

  }

  document.onscroll = scroll;
  });


Actually what I am trying to achieve is something similar to this website http://www.orisnv.be which itself using the modules Single Page Site.

I appreciate any help or hint.

Thanks.
It turns out the answer is simple.  I just declare the javascript inside .info file.  And by using Drupal.behaiors I implement the jquery that target the navbar to fix upon scrolling.