Questions tagged as 'settimeout'

3
answers

Why is it necessary to setTimeout with value 0 (zero)?

I've been observing for some time that some event types only work correctly when we define a certain function that is called with setTimeout with value 0 . On the contrary, if we call this function without setTimeout , unwante...
asked by 27.10.2015 / 14:03
2
answers

What's the difference between these uses of the setTimeout () function?

What's the difference between using setTimeout() so setTimeout(()=>this.logicaRotacao(), 3000) And so? setTimeout(this.logicaRotacao(), 3000)     
asked by 15.11.2018 / 18:36
1
answer

Function for delay / delay opening of a div

I have a floating div with a 'close' button, which makes the hidden / visible. <script language="JavaScript"> function controlaLayer(layerover) { if( document.getElementById(layerover).style.visibility == "hidden" ) { document.ge...
asked by 12.08.2016 / 23:00
2
answers

Angular $ timeout or Javascript timeout?

I am a beginner in Angular JS. I noticed that we have a service in Angular called $timeout . I was curious to understand why this service exists, since natively has setTimeout . What is the difference between $timeout an...
asked by 25.07.2016 / 18:15
3
answers

Index identification changes before time JS

Hello everyone, I have a problem, next I need to create an element and send it via ajax, wait for it to perform (done / fail) and execute an action on that element, but sending and creating elements can be done several times in a row. the return...
asked by 05.10.2015 / 17:21
1
answer

Display image according to time by repeating the javascript function

I'm using this code to display two images on a particular page: <!DOCTYPE html> <!DOCTYPE html> <html> <head> <style> #mapinha { position: relative; top: 0; left: 0; } #mapa_big { position: relative...
asked by 29.01.2017 / 08:22
1
answer

Is there a way to customize the function alert equal to the input required?

My question is somewhat specific, but I would like to know if there is a possibility of creating a message of alert with the default of the input required ? The situation is this: I have a linked div that will forward to another...
asked by 30.04.2018 / 16:21
2
answers

SetTimeout not working, what's wrong?

I need this window to open after 3 seconds, but I can not do that by putting the setTimeout right on the button. Whats wrong? : <script type="text/javascript"> function openWin() { var divText = document.getElementById("div-janela")....
asked by 28.02.2018 / 16:41
1
answer

How to use the setTimeout () method to delay the appearance of a Javascript alert?

Good afternoon, right now I'm developing a javascript, html and css project. it is the Game of the Rooster, the game works only that I need that the warning of victory or of tie only appears after the X or the O. And what is happening is that th...
asked by 18.01.2018 / 17:23
1
answer

Dynamic SetTimeOut with PHP

I'm trying to get an hour of a certain post update every 1 minute. Code: setTimeout(function() { var ID = $(this).attr('id').split('hora')[1]; // pega o ID e retira a parte "like" $.get('index.php?hora=1&id='+ID, fun...
asked by 06.11.2016 / 01:24