diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2018-01-20 17:02:39 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2018-01-20 17:02:39 +0100 |
commit | f147f634277864cd6cfb8d5184c6392e044453c6 (patch) | |
tree | b32e3aa97da2bb7342bf28abc563fc520fdbd7b8 /crocoite | |
parent | 03c8f73d36f7491080adc97732f2da064008badc (diff) | |
download | crocoite-f147f634277864cd6cfb8d5184c6392e044453c6.tar.gz crocoite-f147f634277864cd6cfb8d5184c6392e044453c6.tar.bz2 crocoite-f147f634277864cd6cfb8d5184c6392e044453c6.zip |
behavior: Scroll all DOM elements
One example is Twitter, which uses a popover div for individual tweets.
Scrolling the page won’t scroll that div’s content, which is required to
load more replies.
Diffstat (limited to 'crocoite')
-rw-r--r-- | crocoite/data/scroll.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/crocoite/data/scroll.js b/crocoite/data/scroll.js index 0d1a4a7..13e856d 100644 --- a/crocoite/data/scroll.js +++ b/crocoite/data/scroll.js @@ -7,6 +7,12 @@ function scroll (event) { return false; } else { window.scrollBy (0, window.innerHeight/2); + document.querySelectorAll ('*').forEach ( + function (d) { + if (d.clientHeight < d.scrollHeight) { + d.scrollBy (0, d.clientHeight/2); + } + }); return true; } } |