/venus

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/venus/

« back to all changes in this revision

Viewing changes to themes/asf/personalize.js

  • Committer: Sam Ruby
  • Date: 2008-09-04 13:48:45 UTC
  • Revision ID: rubys@intertwingly.net-20080904134845-f1dvlsdpb4ibazpn
Webkit accomodation

Show diffs side-by-side

added added

removed removed

17
17
 
18
18
// scroll back to the previous article
19
19
function prevArticle(event) {
 
20
  var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
20
21
  for (var i=entries.length; --i>=0;) {
21
22
    if (!entries[i].anchor) continue;
22
 
    if (entries[i].anchor.offsetTop < document.documentElement.scrollTop) {
 
23
    if (entries[i].anchor.offsetTop < scrollTop) {
23
24
      window.location.hash=entries[i].anchor.id;
24
25
      stopPropagation(event);
25
26
      break;
29
30
 
30
31
// advance to the next article
31
32
function nextArticle(event) {
 
33
  var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
32
34
  for (var i=1; i<entries.length; i++) {
33
35
    if (!entries[i].anchor) continue;
34
 
    if (entries[i].anchor.offsetTop-20 > document.documentElement.scrollTop) {
 
36
    if (entries[i].anchor.offsetTop-20 >scrollTop) {
35
37
      window.location.hash=entries[i].anchor.id;
36
38
      stopPropagation(event);
37
39
      break;