Questions tagged [clearinterval]

The Javascript clearInterval() method clears a timer set with the setInterval() method.

The Javascript clearInterval() method clears a timer set with the setInterval() method.
The ID value returned by setInterval() is used as the parameter for the clearInterval() method.

660 questions
3
votes
0 answers

Send user notification every hour with Bot Framework NodeJS

I am developing a bot that sends users a message every hour on skype. It makes an API call and then sends a message containing the parsed message. I started with the welcomebot sample. I then used the switch statement to fire a setInterval()to send…
3
votes
3 answers

How to use setInterval() and clearInterval() in the same function

I'm trying to create a function that starts and stops a timer. The starting is always on the click of a button, but the stopping can be due to the timer running down or the function being called again from another function. This is what I have so…
Jeff S
  • 109
  • 2
  • 13
3
votes
1 answer

How can i stop the reloading of a .txt file with AJAX after loading it with setInterval?

I am building a chatsystem and i am using the AJAX technique for the asynchronous loading of a flat .txt file. Next to the AJAX technique above, i also have a button that lets you manually start and stop the reloading of the flat .txt file. When…
3
votes
4 answers

Javascript clearInterval with button click

I'm having issues getting clearInterval to work when I try to bind it to a button click. Also, apparently the function is starting on it's own... Here's my code var funky = setInterval(function() { alert('hello world'); },…
DjH
  • 1,448
  • 2
  • 22
  • 41
3
votes
2 answers

JavaScript multiple intervals and clearInterval

I have a small program, when you click on an "entry", the editing mode is opened, and the entry is to edit locked for others. There is every 10 seconds sends an ajax request to update the timestamp in the table. $(".entry-edit").click(function() { …
nutzt
  • 2,773
  • 3
  • 17
  • 26
3
votes
2 answers

Can't clearInterval on animation

I have some problem with this code, in this case i set div as a button, when I click the button everything is working as expected but when I want to stop animation with clearInterval it doesn’t work, just keeps looping... What I am doing wrong? var…
3
votes
2 answers

JQuery Mobile popup with history=false autocloses

I'm trying to show a popup but the popup disappears automatically, without the history=false the popup stays visible but then on closing the popup the browser back action is triggered
3
votes
1 answer

Autoscroll with setInterval/clearInterval

Im relatively new to JS coding, and can't get this little number to work. Can anyone tell me what I'm doing wrong? My JavaScript is: incrementScroll = function() { window.scrollBy(0, 3) ; } startScrollLoop = function() { …
Johnny Venom
  • 325
  • 4
  • 8
3
votes
0 answers

how to use two slider with one jquery plugin, also same setInterval

I have prepared a slider and I want to use it more than once in a page. Therefore I am trying to prepare a plugin. The first slider which I have prepared doesn't work while the second slider works. In my opinion, ClearInterval doesn't work on first…
3
votes
2 answers

clearInterval fails in one scenario but not the other

I'm running a function to check if a database entry exists. On my page load I check if an element exists and if it does I use setInterval to run a function. Like so: if ( $('#encoding').length ) { console.log("auto_update start"); var…
deadlyhifi
  • 577
  • 5
  • 15
3
votes
1 answer

using jQuery .promise() to call clearInterval()

I have been experimenting a lot with setInterval and clearInterval recently, for creating my own custom effects and one of the things that I have been working on is an efficient way to clear an interval whilst staying out of the global scope. I am…
Zachary Kniebel
  • 4,686
  • 3
  • 29
  • 53
3
votes
3 answers

javascript: stop setInterval after element removal

I want to execute clearInterval function automatically after removing div which containing setInterval function and this div is the result of ajax response because it don't stop itself after removing the div. $('#element').mouseover(function(){ …
semsem
  • 1,194
  • 12
  • 24
3
votes
1 answer

setinterval() and clearinterval() - when cleared, does not animate automatically

So I'm trying to build an animating background image which will cycle through an array of images. The idea is also that when you click any navigation element on the page, the cycle will pause. When you click on the home button, the cycle is to…
user1364910
2
votes
1 answer

Why doesn't the clearInterval() works?

I'm new to JavaScript and I'm having problems with this script. it's part of a web game and the script is suppose to refresh the page until the player wins or loses. for some reason it doesn't stop refreshing, I put an alert function to check if the…
kirlev
  • 680
  • 1
  • 7
  • 17
2
votes
4 answers

setInterval and clearInterval not working as expected

I have this function which acts as a loading box using setInterval to change the background images which creates a flashing effect. function loading() { clearInterval(start); var i = 0; function boxes() { in_loading =…
Technotron
  • 21
  • 2
  • 4