Skip to content

Commit

Permalink
added fade out on scroll - we can pull this if you prefer it
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Jul 24, 2012
1 parent e38fa4b commit c98b75c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docs/assets/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@

$(function(){

// fancy fade jumbotron

var $jumbotron = $('.jumbotron')
, $jcontainer = $('.jumbotron .container')
, opacRatio = ($jumbotron.height() / 200 ) * 2

$(window).on('scroll', function () {
var diff = 100 - ($(window).scrollTop() / opacRatio)
$jcontainer.css({ opacity: (diff > 0 ? Math.min(diff, 100) : 0) / 100 })
})

// Disable certain links in docs
$('section [href^=#]').click(function (e) {
e.preventDefault()
Expand Down

0 comments on commit c98b75c

Please sign in to comment.