mirror of
https://bitbucket.org/skobkin/chrome_point_plus.git
synced 2024-11-23 18:56:04 +00:00
Space key fix from pull request #25.
This commit is contained in:
parent
aa7b9649d1
commit
3e6e3d5855
|
@ -1089,14 +1089,12 @@ function set_space_key_skip_handler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function space_key_event() {
|
function space_key_event() {
|
||||||
var scroll_current = $('body').scrollTop();
|
var scroll_current = Math.floor($('body').scrollTop());
|
||||||
var scroll_step_size = 0;
|
|
||||||
var scroll_real = Math.max(scroll_current - scroll_step_size, 0);
|
|
||||||
|
|
||||||
var posts = $('.content-wrap > .post');
|
var posts = $('.content-wrap > .post');
|
||||||
for (var i = 0; i < posts.length; i++) {
|
for (var i = 0; i < posts.length; i++) {
|
||||||
var this_top_px = $(posts[i]).offset().top;
|
var this_top_px = Math.floor($(posts[i]).offset().top);
|
||||||
if (this_top_px > scroll_real) {
|
if (this_top_px > scroll_current) {
|
||||||
$('body').animate({
|
$('body').animate({
|
||||||
'scrollTop': this_top_px
|
'scrollTop': this_top_px
|
||||||
}, 200);
|
}, 200);
|
||||||
|
|
Loading…
Reference in a new issue