我创建了一个jsfiddle 来演示窗口滚动事件的用法dojo/on
。
html:
<body>
<div style="height:1000px;">
Bacon ipsum dolor sit amet meatball drumstick jerky strip steak kielbasa shoulder, short ribs filet mignon prosciutto swine meatloaf ribeye tongue turkey andouille. Hamburger bacon fatback, short ribs pork loin cow chicken. Capicola venison andouille kielbasa cow. Short ribs kevin rump meatloaf jowl prosciutto leberkas. Pork belly shankle doner spare ribs, rump pork chop sausage tenderloin. Brisket swine pig, fatback beef ribs shank tri-tip flank ham venison strip steak filet mignon rump frankfurter ribeye.
Fatback turkey sausage tongue doner strip steak boudin shoulder chuck beef ribs chicken bacon brisket. Turkey biltong bacon cow short ribs fatback. Sausage brisket pork loin corned beef pork chop shank jowl capicola leberkas strip steak prosciutto beef tri-tip. Jowl frankfurter beef ribs, swine tail doner tri-tip t-bone. Jowl pork loin sausage venison salami shankle kevin strip steak boudin doner bresaola filet mignon ham drumstick ribeye. Turkey pork belly kielbasa ribeye salami, strip steak ham hock jerky shoulder tenderloin shankle spare ribs beef ribs filet mignon. Short loin fatback kevin, biltong tail shoulder ball tip.
Pork loin t-bone ground round tongue turducken tail shoulder chicken sausage pancetta hamburger, kielbasa tri-tip strip steak short ribs. Pork chop prosciutto tri-tip, jerky brisket leberkas andouille ham hock tongue shoulder fatback meatball. Pig short loin beef spare ribs, rump meatball short ribs doner kielbasa ball tip swine bacon kevin. Hamburger tail frankfurter ham hock tongue, jerky pork belly bacon shank salami prosciutto ground round doner jowl turducken. Prosciutto pork chop drumstick ham hock meatloaf. Drumstick ham hock ball tip salami cow.
Shankle hamburger sirloin sausage tongue pork chop flank, doner pig tri-tip pancetta shoulder. Venison ball tip beef biltong tail, corned beef pastrami andouille frankfurter kevin pork meatball chicken. Ground round shankle sirloin capicola kevin spare ribs ham hock fatback strip steak short ribs leberkas. Venison flank tenderloin tri-tip salami pork capicola drumstick brisket short ribs sirloin chuck boudin kielbasa cow.
Short ribs corned beef shankle meatball, tri-tip t-bone sirloin cow leberkas chicken jerky. Short loin drumstick pork loin biltong sausage prosciutto rump flank hamburger pork chop meatball capicola turkey leberkas cow. Andouille ribeye boudin ham chicken. T-bone rump meatball drumstick hamburger pork chop, flank sausage tongue andouille fatback.
Does your lorem ipsum text long for something a little meatier? Give our generator a try… it’s tasty!
</div>
</body>
js:
require(['dojo/on','dojo/domReady!'],function(on,domReadyPlugin){
on(window,'scroll',function(evt){
console.log(evt);
});
});
每次用户在窗口中滚动时,结果都会打印到控制台。如果您仍然遇到问题,请发布更多代码以便我们深入了解它,这应该是一件简单的事情。