Home > Web Front-end > JS Tutorial > Js setInterval and setTimeout (timing execution and loop execution) code (parameters can be passed in)_javascript skills

Js setInterval and setTimeout (timing execution and loop execution) code (parameters can be passed in)_javascript skills

WBOY
Release: 2016-05-16 18:25:12
Original
1314 people have browsed it

Document's own methods:
Loop execution: var timeid = window.setInterval ("Method name or method", "Delay"); window.clearInterval(timeid);
Timing execution: var tmid = window. setTimeout("Method name or method", "Delay"); window.clearTimeout(tmid);
Example:
A. When no parameters are required in the method to be executed

Copy code The code is as follows:



B. When parameters are required in the method to be executed
Copy code The code is as follows:


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template