diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 3e9eb2e68..2d91dd541 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -4,6 +4,16 @@ */ var View = { initialize: function() { + + $(window).scroll(function(){ + var header = $('header'); + if( $(this).scrollTop() > 30){ + header.addClass('fixit'); + } else { + header.removeClass('fixit'); + } + }); + /* Buttons */ $("input:submit").addClass("button"); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index c724e8524..957abc475 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -136,11 +136,16 @@ header :top 2px :color #CCC - :position fixed + :position absolute + :width 100% :top 0 :left 0 + &.fixit + :position fixed + :top -30px + a :color #CCC