Add parameters to settimeout method in js

高洛峰
Release: 2017-02-08 16:11:45
Original
1047 people have browsed it

This article mainly introduces the settimeout method and parameters in js. Friends who need it can refer to the use of the settimeout method and parameters in js.


Simple use, see w3school
There is no parameter call,
Example:

Copy codeThe code is as follows:

 
 
Copy after login


My current problem is that between multiple ones, only the last one is returned. Think about it

Copy codeCode As follows:

/* for (var i=0;i
        
Copy after login


The reason for the above error is that when time is triggered for execution, i=4, so although there are multiple ones, it is always the last one
Solution

Copy codeThe code is as follows:

var timerr; function xunhuanlian(points,value){ if(replayi
         
          
Copy after login

For more articles related to adding parameters to the settimeout method in js, please pay attention to the PHP Chinese website!

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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!