into_viewport という関数を作ってみた。 Chrome 以外ではチェックしてない。(でも IE 含め、他のブラウザで使えない関数などは使ってないはず) IE に getComputedStyle が無いのを忘れてた。var s = getComputedStyle(elem, null); のところを var s = window.getComputedStyle ? getComputedStyle(elem, null) : elem.currentStyle; にしたらいいのかな? (IE 持ってないのでわからない) 微修正。body や html 要素に overflow:auto などが着いてると変なことになる件。あと、Firefox と Opera では互換モードのとき document.body.scrollTop が使えて、標準モードのときは document.
![ある要素が見える位置までスクロール - by edvakf in hatena](https://cdn-ak-scissors.b.st-hatena.com/image/square/b13458ef0b1939a076fdfab4f08a0a66ae4779bd/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fe%2Fedvakf%2F20100202%2F20100202155752.png)