]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
added fade out on scroll - we can pull this if you prefer it
authorJacob Thornton <jacobthornton@gmail.com>
Tue, 24 Jul 2012 07:48:45 +0000 (00:48 -0700)
committerJacob Thornton <jacobthornton@gmail.com>
Tue, 24 Jul 2012 07:48:45 +0000 (00:48 -0700)
docs/assets/js/application.js

index 9f1fa704f35d11f00cc9f54d047cc3a36457756a..e096f086655de9b1508c8f056f39ae858c8d3c57 100644 (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()