简体   繁体   English

在哪里可以找到流星模板事件的列表?

[英]Where can I find a list of Meteor template events?

I couldn't find this information in the Meteor documentation. 我在“流星”文档中找不到此信息。 So I wrote 所以我写了

$(document).ready(function(){
  $(window).scroll(function(){
    console.log("!");
  })
})

'scroll window' displays no result. “滚动窗口”没有显示结果。

There is no list of Meteor template events because they are the same as DOM events ( click , change , submit , etc...). 没有Meteor模板事件列表,因为它们与DOM事件( clickchangesubmit等)相同。

However, if you want to run code when the DOM is ready, you have to use Meteor.startup client-side : 但是,如果要在DOM准备就绪时运行代码,则必须使用Meteor.startup客户端:

client/startup.js

Meteor.startup(function(){
  $(window).scroll(function(){
    console.log("scroll event !");
  });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM