File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
function moveScroller ( ) {
2
+ var c = $ ( "#scroller" ) ;
3
+ var uh = $ ( c ) . height ( ) ;
2
4
var a = function ( ) {
3
5
var b = $ ( window ) . scrollTop ( ) ;
4
6
var d = $ ( "#scroller-anchor" ) . offset ( ) . top ;
5
- var c = $ ( "#scroller" ) ;
6
- if ( b > d ) {
7
+ var e = $ ( ".footer" ) . offset ( ) . top ;
8
+ if ( b > d && ( ( b + $ ( window ) . height ( ) ) ) < e ) {
7
9
c . css ( { position :"fixed" , top :"60px" } )
8
10
} else {
9
11
if ( b <= d ) {
10
- c . css ( { position :"relative" , top :"" } )
12
+ c . css ( { position :"relative" , top :"" } ) ;
13
+ } else {
14
+ // wrapper height must be calculated here because of disqus
15
+ var wh = $ ( '.wrapper' ) . height ( ) ;
16
+ var calc = ( - 1 * Math . abs ( wh - b - d - uh - 60 ) ) ;
17
+ c . css ( { position :"fixed" , top :calc + "px" } ) ;
11
18
}
12
19
}
13
20
} ;
14
21
$ ( window ) . scroll ( a ) ; a ( )
15
- }
22
+ }
23
+
24
+ $ ( function ( ) { moveScroller ( ) ; } ) ;
You can’t perform that action at this time.
0 commit comments