Jump to content


Photo

Delay displaying text


  • Please log in to reply
2 replies to this topic

#1 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 12 October 2006 - 02:41 PM

Hi,

I read from a MySQL database using PHP and I am curious how can I delay displaying the lines by lines of information with Javascript?

Output:

You age slowly

[wait 2 secs]

You age slowly some more

[wait 2 secs]

You age really slow now

[wait 2 secs]

So that it outputs the first line, waits 2 seconds, then outputs the 2nd line, waits 2 sec, etc.

I've seen this done, but not sure how they do it.

Thanks.

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 12 October 2006 - 03:45 PM

Try using setTimeout()... I guess you could hide divs you've already written, or just write out the page dynamically (i.e. set .innerHTML).
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#3 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 12 October 2006 - 04:22 PM

Ah thank you, the setTimeout() works perfectly.

:)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users