Skip to content

Commit f7cffdd

Browse files
committed
fix scroll back
1 parent c37ef55 commit f7cffdd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

js/post.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ $(document).ready(function(){
143143
});
144144

145145
var menuIndexTop = $('#menuIndex').offset().top;
146+
var menuIndexLeft = $('#menuIndex').offset().left;
146147

147148
$(window).scroll(function(){
148149
waitForFinalEvent(function(){
@@ -154,11 +155,13 @@ $(document).ready(function(){
154155
$('#menuIndex').css({
155156
position:'fixed'
156157
,top:'20px'
158+
,left:menuIndexLeft
157159
});
158160
}else{
159161
$('#menuIndex').css({
160162
position:'static'
161163
,top:0
164+
,left:0
162165
});
163166
}
164167

@@ -178,6 +181,16 @@ $(document).ready(function(){
178181
});
179182

180183
$(window).resize(function(){
184+
$('#menuIndex').css({
185+
position:'static'
186+
,top:0
187+
,left:0
188+
});
189+
190+
menuIndexTop = $('#menuIndex').offset().top;
191+
menuIndexLeft = $('#menuIndex').offset().left;
192+
193+
$(window).trigger('scroll')
181194
$('#menuIndex').css('max-height',$(window).height()-80);
182195
});
183196
})

0 commit comments

Comments
 (0)