Image stabilization throttle function

The so-called image stabilization, is that the function can only be performed once in n seconds after the trigger event, if n seconds and triggered the event, it will recalculate the function execution time.

Image stabilization function is divided into a non-executive function and immediately execute the function immediately

 

 

 

 

 

 Codes in the image stabilization function is also to be noted that this transfer of parameter and

let context = this;
let args = arguments;

Code anti-shake function uses these two lines of code to get this and parameters, in order to make the final debounce function returns the same function this point and still be able to receive e parameters.

Throttle function is generally divided into a timestamp version and the version timers

Throttling: The so-called throttling, it refers to the continuous trigger events but only once a function in n seconds. Throttling dilution is a function of frequency.

 

 

 

Guess you like

Origin www.cnblogs.com/wxiaoq/p/11453806.html