0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-17 09:52:29 +01:00

added fade out on scroll - we can pull this if you prefer it

This commit is contained in:
Jacob Thornton 2012-07-24 00:48:45 -07:00
parent e38fa4b1f4
commit c98b75c979

View File

@ -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()