2 //caches a jQuery object containing the header element
4 var $intro = $(".stack-intro");
5 var $apart = $(".stack-apart");
12 var computePositions = function() {
13 // Find the offset-top for the items
14 windowHeight = window.innerHeight
15 introTop = $intro.offset().top
16 apartTop = $apart.offset().top
17 introHeight = $intro.height()
18 apartHeight = $apart.height()
21 var computeAndCheckPositions = function() {
26 var checkScroll = function() {
29 var windowTop = $(window).scrollTop();
30 var windowBottom = windowTop + windowHeight
32 if (introTop > windowTop && ((introTop+(windowHeight/2)) < windowBottom)) {
33 $intro.removeClass('animate-false').addClass('animate-true');
35 if (apartTop > windowTop && ((apartTop+(windowHeight/2)) < windowBottom)) {
36 $apart.removeClass('animate-false').addClass('animate-true');
40 $(window).on('resize',computePositions)
41 $(window).on('scroll',checkScroll)
43 computeAndCheckPositions()
44 setTimeout(computeAndCheckPositions, 1000)
45 setTimeout(computeAndCheckPositions, 4000)
46 setTimeout(computeAndCheckPositions, 10000)
50 $('.menu-toggle').on('click', function() {
51 $('nav').toggleClass('menu-hide menu-show');
52 $('body').toggleClass('overflow-hidden');
57 $('.sidebar-toggle').on('click', function() {
58 $('#sidebar-mobile').toggleClass('sidebar-hide sidebar-show');
59 $('body').toggleClass('overflow-hidden');
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list