This is a discussion on "delaying output" within the JavaScript Forum section. This forum, and the thread "delaying output are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
delaying output
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
delaying output
I'm trying to make a webpage that will open a number of images at the start, but there needs to be a pause between one image and the next. This is the code I wrote (well, the only difference is that this one is around 150 images short):
Last edited by karinne; Sep 18th, 2007 at 15:34. Reason: Please use the vBcode [ code ] when inserting code in your post. |
|
|
|
||||
|
Re: delaying output
Okay so I can see a couple of problems here.
setTimeout requires a string that will be eval's when it's run so just having a statement won't work and you would be better with a function to call back rather than a for loop.
Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: delaying output
I gave it a try but nothing was output to screen
|
|
||||
|
Re: delaying output
Oops, forgot to actually put the initial function call in
![]() After function imageWrite { document.write(address[imgtoWrite]); imgtoWrite++; if (imgtoWrite < address.length) timer = setTimeout('imageWrite()', 1500); } put imageWrite();
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: delaying output
It works, at least a little bit. The first image is displayed, then the second, and then at the bottom left of IE it says error on page. Firefox displays the first, that blanks out, then nothing.
Last edited by theosx; Sep 19th, 2007 at 04:33. |
|
||||
|
Re: delaying output
Pretty sure it's because document.write() destroys the whole document.
You may have to try
Cheers
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Php output in to CSS | dhossai | Web Page Design | 1 | Oct 30th, 2007 18:38 |
| Distinct output using ASP/SQL | bullrider | Classic ASP | 0 | May 29th, 2007 16:55 |
| displaying the output | madhuri.t | Classic ASP | 3 | Jul 12th, 2006 15:49 |
| output IE vs. FF | jojo | Web Page Design | 5 | Dec 29th, 2005 13:35 |
| no output at all -- can't see why in code (???) | jswebdev | PHP Forum | 8 | Oct 16th, 2005 05:07 |