From 2d238f5a314b0d78e3f5df6a4b0b5e095e3defe0 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Thu, 4 Sep 2008 09:48:45 -0400 Subject: [PATCH] Webkit accomodation --- themes/asf/personalize.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/asf/personalize.js b/themes/asf/personalize.js index f89b714..31a86a0 100644 --- a/themes/asf/personalize.js +++ b/themes/asf/personalize.js @@ -17,9 +17,10 @@ function stopPropagation(event) { // scroll back to the previous article function prevArticle(event) { + var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; for (var i=entries.length; --i>=0;) { if (!entries[i].anchor) continue; - if (entries[i].anchor.offsetTop < document.documentElement.scrollTop) { + if (entries[i].anchor.offsetTop < scrollTop) { window.location.hash=entries[i].anchor.id; stopPropagation(event); break; @@ -29,9 +30,10 @@ function prevArticle(event) { // advance to the next article function nextArticle(event) { + var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; for (var i=1; i document.documentElement.scrollTop) { + if (entries[i].anchor.offsetTop-20 >scrollTop) { window.location.hash=entries[i].anchor.id; stopPropagation(event); break;