Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #16326

Re: setimeout() problem

Newsgroups comp.lang.javascript
Date 2012-10-02 22:49 -0700
References <506bccbe$0$16500$426a74cc@news.free.fr>
Message-ID <08869374-503e-41a0-aee6-69fb271bf5d7@googlegroups.com> (permalink)
Subject Re: setimeout() problem
From ankit pandey <blackhill08@gmail.com>

Show all headers | View raw


On Wednesday, 3 October 2012 10:57:26 UTC+5:30, jmrw  wrote:
> http://www.jmrw.com/Chess/Tableau_echecs/index.htm#diaporama
> 
> 
> 
> On this page the button "stop" doesn't work everytime..
> 
> 
> 
> <button id="but_stop" onClick="stop()"> stop </button>
> 
> 
> 
> function stop() {clearTimeout(play); play = false; }
> 
> 
> 
> It should stop this function:
> 
> 
> 
> function diaporamarandom() {
> 
> c++;
> 
> document.getElementById('quantite').value = c;
> 
> c=Math.floor(Math.random()*listechrono.length)
> 
> document.getElementById('vue').style.backgroundImage = 
> 
> 'url(images/'+liste[c]+'.jpg)';
> 
> play = setTimeout('diaporamarandom()',tempo); }
> 
> 
> 
> I don't understand why.
> 
> 
> 
> thanks
> 
> 
> 
> jmrw

It works on 3rd time click

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

setimeout() problem "jmrw" <jmrw@free.fr> - 2012-10-03 07:27 +0200
  Re: setimeout() problem ankit pandey <blackhill08@gmail.com> - 2012-10-02 22:49 -0700
    Re: setimeout() problem "jmrw" <jmrw@free.fr> - 2012-10-03 07:57 +0200
      Re: setimeout() problem "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-03 06:24 +0000
        Re: setimeout() problem "jmrw" <jmrw@free.fr> - 2012-10-03 09:55 +0200
          Re: setimeout() problem "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-03 10:56 +0000
  Re: setimeout() problem Tim Streater <timstreater@greenbee.net> - 2012-10-03 09:17 +0100
    Re: setimeout() problem "jmrw" <jmrw@free.fr> - 2012-10-03 10:37 +0200
    Re: setimeout() problem "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-03 10:59 +0000
  Re: setimeout() problem "jmrw" <jmrw@free.fr> - 2012-10-03 12:04 +0200
    Re: setimeout() problem "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-03 11:02 +0000
      Re: setimeout() problem "jmrw" <jmrw@free.fr> - 2012-10-03 16:52 +0200
        Re: setimeout() problem "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-10-03 15:05 +0000
        Re: setimeout() problem Dr J R Stockton <reply1240@merlyn.demon.co.uk.invalid> - 2012-10-04 20:00 +0100
    Re: setimeout() problem Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-03 05:54 -0700
      Re: setimeout() problem "jmrw" <jmrw@free.fr> - 2012-10-03 16:50 +0200
        Re: setimeout() problem Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-03 10:10 -0700
  Re: setimeout() problem "jmrw" <jmrw@free.fr> - 2012-10-03 22:15 +0200
    Re: setimeout() problem Scott Sauyet <scott.sauyet@gmail.com> - 2012-10-03 13:30 -0700
    Re: setimeout() problem Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-10-04 12:26 +0200

csiph-web