質問

Is there a Dojo method that wraps window.onscroll?

I want to be able to capture the page scrolling. I can capture the mousewheel but can't seem to find any reference to capturing the actual page scroll. I've tried lots of variations but the event just doesn't seem to fir at all.

any ideas?

役に立ちましたか?

解決

dojo.connect(window, 'onscroll', this, function(event) {
    var scrollTop = dojo._docScroll().y;

    //code to handle scroll
});

This works for me whether the document is scrolled via mousewheel, scrollbar, or up/down keys, which just about covers all scroll scenarios.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top