throttle

dojo/throttle

Summary

Create a function that will only execute once per wait periods.

Create a function that will only execute once per wait periods from last execution when called repeatedly. Useful for preventing excessive calculations in rapidly firing events, such as window.resize, node.mousemove and so on.

Usage

throttle(cb,wait);
Parameter Type Description
cb Function

The callback to fire.

wait Integer

time to delay before allowing cb to call again.

Methods

© 2005–2015 The Dojo Foundation
Licensed under the AFL 2.1 and BSD 3-Clause licenses.
http://dojotoolkit.org/api/1.10/dojo/throttle.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部