Skip to content

Commit

Permalink
Merge pull request StartBootstrap#62 from Deadolus/gh-pages
Browse files Browse the repository at this point in the history
Fading the "Scroll to Top" button in and out
  • Loading branch information
davidtmiller committed Jan 29, 2016
2 parents 0c71c75 + 71464c1 commit 1e9461a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ <h3>About Freelancer</h3>
</footer>

<!-- Scroll to Top Button (Only visible on small and extra-small screen sizes) -->
<div class="scroll-top page-scroll visible-xs visible-sm">
<div class="scroll-top page-scroll hidden-sm hidden-xs hidden-lg hidden-md">
<a class="btn btn-primary" href="#page-top">
<i class="fa fa-chevron-up"></i>
</a>
Expand Down
10 changes: 8 additions & 2 deletions js/cbpAnimatedHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ var cbpAnimatedHeader = (function() {
var sy = scrollY();
if ( sy >= changeHeaderOn ) {
classie.add( header, 'navbar-shrink' );
}
$('.scroll-top').removeClass('hidden-sm hidden-xs');
$('.scroll-top').fadeIn(500);
}
else {
classie.remove( header, 'navbar-shrink' );
$('.scroll-top').fadeOut(500, function() {
$('.scroll-top').addClass('hidden-sm hidden-xs');
});

}
didScroll = false;
}
Expand All @@ -41,4 +47,4 @@ var cbpAnimatedHeader = (function() {

init();

})();
})();

0 comments on commit 1e9461a

Please sign in to comment.