File tree 2 files changed +25
-1
lines changed
doc/source/themes/nature_with_gtoc
2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -66,4 +66,28 @@ <h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
66
66
</ div >
67
67
</ div >
68
68
</ div >
69
+
70
+ < script type ="text/javascript ">
71
+ // http://movethewebforward.org/
72
+ // paul irish et al. we <3 you.
73
+ var $body = $ ( document . body ) ;
74
+
75
+ var $scrollable = $ ( window ) ; // default scrollable thingy, which'll be body or docEl (html)
76
+ $originalnavtop = 52 ; //$scrollable.css('top');
77
+
78
+ // work on scroll, but debounced
79
+ var $document = $ ( document ) . scroll ( function ( ) {
80
+ var $nav = $ ( "div.sphinxsidebar" ) ;
81
+ if ( $scrollable . scrollTop ( ) > ( $originalnavtop - 20 ) ) {
82
+ $nav . addClass ( 'sticky' ) . css ( 'top' , '0' ) ;
83
+ $nav . addClass ( 'sticky' ) . css ( 'position' , 'fixed' ) ;
84
+ } else {
85
+ $nav . removeClass ( 'sticky' ) ;
86
+ $nav . addClass ( 'sticky' ) . css ( 'position' , '' ) ;
87
+ $nav . addClass ( 'sticky' ) . css ( 'top' , '' ) ;
88
+ }
89
+
90
+ } ) ;
91
+ </ script >
92
+
69
93
{%- endblock %}
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ div.sphinxsidebar {
79
79
width: {{ theme_sidebarwidth|toint }}px;
80
80
margin: 0 ;
81
81
float: left;
82
-
82
+ /*position: fixed;*/
83
83
background-color: #eee;
84
84
}
85
85
/*
You can’t perform that action at this time.
0 commit comments