Dojo window.onscroll [英] Dojo window.onscroll

查看:171
本文介绍了Dojo window.onscroll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想要能够捕获页面滚动,是否有Dojo方法包装window.onscroll?我可以捕捉鼠标,但似乎没有找到任何参考来捕获实际的页面滚动。我尝试了很多变化,但事件根本看起来似乎并不冷静。



任何想法?

解决方案

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

//代码来处理滚动
});

这对我来说无论文档是通过鼠标滚轮,滚动条还是上/下键滚动,关于覆盖所有滚动方案。


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.

这篇关于Dojo window.onscroll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆