Most voted "settimeout" questions
22 questions
Sort by count of
-
42
votes2
answers1922
viewsWhy do they say that recursive setTimeout is better than setInterval?
I see online a series of articles with titles like: setInterval is bad, which translating would be setInterval is ruin. I saw recommendations to use an anonymous recursive function with a…
-
20
votes3
answers3474
viewsWhy is it sometimes necessary to setTimeout with a value of 0 (zero)?
I have observed for some time that some types of event only work correctly when we define a certain function that is called with the setTimeout worthwhile 0. On the contrary, if we call this…
-
5
votes1
answer36
viewsWhy can’t I use add operator in function with this?
Why when I run the following code: function Pessoa(){ this.idade = 0; console.log(this.idade); setTimeout(function() { this.idade++; console.log(this.idade); }, 2000); } new Pessoa(); My way out is…
-
3
votes2
answers170
viewsWhat is the difference between these uses of the setTimeout() function?
What’s the difference between using the setTimeout() thus setTimeout(()=>this.logicaRotacao(), 3000) and so? setTimeout(this.logicaRotacao(), 3000)…
-
2
votes2
answers387
viewsAngular $timeout or Javascript timeout?
I’m a beginner in Angular JS. I realized that we have a service in Angular called $timeout. I was curious to understand why this service exists, since Javascript natively has the setTimeout. What is…
-
2
votes1
answer2529
viewsDelay/delay function for opening a div
I have a floating div with a 'close' button, which makes Hidden / Visible. <script language="JavaScript"> function controlaLayer(layerover) { if(…
-
1
votes3
answers63
viewsId of Dice changes before JS time
Hello guys I’m having a huge problem, next I need to create an element and send via ajax wait for the return (done/fail) and perform an action on this element, but sending and creating elements can…
-
1
votes1
answer520
viewsDisplay image according to time by repeating javascript function
I am using this code to display two images on a given page: <!DOCTYPE html> <!DOCTYPE html> <html> <head> <style> #mapinha { position: relative; top: 0; left: 0; }…
-
1
votes1
answer280
viewsHow do I use the setTimeout() method to delay the appearance of an Alert in Javascript?
Good afternoon, at this time I am developing a javascript, html and css project. It is the game of the Rooster, the game works only that I need the Alert of victory or draw only appear after the X…
-
1
votes1
answer102
viewsIs there a way to customize Function Alert equal to the input required?
My question is somewhat specific, but I would like to know if there is a possibility to create a message from alert with the input pattern required? The situation is as follows: I have a linked div…
-
0
votes1
answer188
viewsDynamic settimeout with PHP
I’m trying to get a certain time post update every 1 minute. Code: setTimeout(function() { var ID = $(this).attr('id').split('hora')[1]; // pega o ID e retira a parte "like"…
-
0
votes2
answers55
viewsSettimeout not working, what’s wrong?
I need this window to open after 3 seconds, but I’m not getting by putting the setTimeout right on the button. What’s wrong? : <script type="text/javascript"> function openWin() { var divText…
-
0
votes0
answers65
viewsMeta Theme-color and background with equal colors
Talk people...(don’t mind if I talk any nonsense during the text, I’m secular about it). I am since yesterday developing a page using javascript settings to make an interaction. My challenges were:…
-
0
votes2
answers141
viewssetTimeout - the image not fixed on the screen (P5.js)
Programming in javascript/P5.js I’m trying to use the setTimeout function, but the image, when triggered, is flashing on the screen, not fixed. The idea is that the ellipse appears after a certain…
-
0
votes1
answer312
viewsHow can I stop Settimeout on C#
Hello, How can I stop the execution of Setimeout created in javascript only in C#? I Gero several PDF through this method. Below is the script: function geracao(formulario) {…
-
0
votes1
answer98
viewssetTimeout with each loop does not work
count = 1; $("a.btns").each(function() { if ($(this).parent("span").attr("id") == "btn_default") { return; } count++; these = $(this); setTimeout(function() { $(these).click(); }, 10000 * count);…
-
0
votes1
answer178
viewsHow do I set the call timeout of an EJB function?
At the end of a service my project has a function that takes an EJB from another project that is installed on the same server, and accesses one of its functions. My function that takes the EJB and…
-
0
votes1
answer564
viewsHow can I create a pause and resume function setTimeout()?
I need to create a kind of pause and resume, can be with Javascript (without jQuery). I have a slide photos, each photo appears every 3 seconds with setTimeout() and in this way (as they see the…
-
0
votes1
answer53
viewsPreloader with static delay in JS function
Fala Galera! I can’t seem to get my preloader function correctly, because even declaring in the function the delay via setTimeout is not executed. At the same time, my fadeOut is not respecting the…
-
0
votes1
answer53
viewsHow do I perform a setTimeout after another setTimeout?
I have the following code inside my script: (Function() { 'use Strict'; let $leftside_div = document.querySelector('.leftside-div'); let $centerside_div = document.querySelector('.centerside-div');…
-
-1
votes1
answer77
viewssetTimeOut error Uncaught Referenceerror: lightning_one is not defined
I created a Function to generate display effect for a certain time, the images are loaded only in the page load, then Uncaught ReferenceError: lightning_one is not defined as shown below: the…
-
-2
votes2
answers84
viewsHow do I create a time interval in the execution of a for?
How I create a 1 second interval in the execution of the for or of function? JavaScript: function Linha1() { for (var i1 = 0; i1 <= 3; i1++, Linha1.setInterval(1000)) { if (notas1[0][i1] == 1) {…