Scroll event for Meteor

后端 未结 5 1712
没有蜡笔的小新
没有蜡笔的小新 2021-02-07 20:29

I couldn\'t find a scroll event for meteor in the meteor docs. How do I go about doing something as someone scrolls the window down in a meteor application?

I\'ve tried

5条回答
  •  旧巷少年郎
    2021-02-07 21:01

    This is really late at this point, and I assume much has changed since the question was asked, but I came across this problem myself, and for anyone else that may need to know, the method that I found to work was to create a helper called 'scroll .container' where the container is a div that contains the main body of the page (where the user would scroll in my application) My function looked something like this :

    Template.main_page.events({
        'scroll .container': function(event) {
            console.log(event.currentTarget.scrollTop);
        }
    
    });
    

提交回复
热议问题