Solved

making letters to appear one by one

Posted on 2009-06-27
5
190 Views
Last Modified: 2013-11-19
My question is in the following web page:

http://www.pinyinology.com/listing/letters.html

it will be for a web page.  Thanks.

0
Comment
Question by:fuli3665
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 28

Expert Comment

by:gamebits
ID: 24728778
Few questions

1)Would the table always be the same size (same number of letters)
2)What is the intend of the process (is for a game of some sort)?
3)When you say one letter at a time do you mean the user will have to click the button everytime to get a new letter or do you mean starting to show the letters one at a time with a slight delay in between?
4)From where are the letters coming, are the words kept in a database?
5)Are you using a server side language like php or is it Javascript etc.?
0
 

Author Comment

by:fuli3665
ID: 24728954
1) The table and boxes' size will not change.

2) The interactivity will take place  in an essay I wrote:

http://www.pinyinology.com/wheel/fortune.html

The Chinese letters will appear one after another, then disappear altogether  by pushing the 'reset' button.  My intention is that an expert does a piece of the work, i then apply  the code to  that page.

3) Clicking the button one time will cause  the letters to appear one by one continuously. Not one clicking one letter. The letters can appear one by one, with or without stop between the letters.

4) I prefer no database at all.  Everything  is done on the html page, with javascript scripting.

5) I like the letters' display and hide are all manipulated by scripting only.

6). If it is hard to achieve the appearance of one letter after another, all the letters can show up altogether in the mean time.
0
 
LVL 10

Accepted Solution

by:
jfromanski earned 500 total points
ID: 24728979
See attached.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>letters</title>
<style type='text/css'>
body {margin:50px;}
table {border-collapse:collapse;}
td {border:3px blue solid; width:30px; height:30px; text-align:center;}
#first {margin-bottom:20px;}
</style>
<script>
var text2beshown='FLORIDA';
var tout;
var lno;
var show=0;
 
function showLetter(){
  document.getElementById('td'+lno).innerHTML = show?text2beshown.charAt(lno):'&nbsp;';
  lno++;
  if( lno<text2beshown.length ) tout=setTimeout("showLetter()",show?200:1);
}
 
function showIt(){
  lno=0;
  show=1;
  showLetter();
}
 
function hideIt(){
  lno=0;
  show=0;
  showLetter();
}
 
</script>
</head>
<body>
 
<table id='first'>
<tr>
<script>
for( var i=0;i<text2beshown.length;i++ ){
  document.write('<td><span id="td'+i+'">&nbsp;</span></td><br />');
}
</script>
</tr>
 
</table>
 
<form>
 
<input type='button' value='show letters' name='name1' onClick="showIt()"/>
 
<input type='button' value='reset' name='name2' onClick="hideIt()" />
 
</form>
 
<br />
 
<p>
When the page is opened, the top table, not the bottom one, appears. When clicking the 'show letters' button, the letters will apear in the boxes of the TOP table. It is better that the letters appear one after another from left to right, rather than in the same time.    </p>
 
<p>
When clicking the 'reset' button, all letters disappear. 
</p>
 
<p>
Note:  there is only one table, not two. 
</p>
</body>
</html>

Open in new window

0
 
LVL 10

Expert Comment

by:jfromanski
ID: 24729026
Oops! My code should work with Chinesee characters, but I cant check it...
0
 

Author Closing Comment

by:fuli3665
ID: 31597582
Wonderful solution. Thanks a million,
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
replica website 2 72
locate sql commands in C# visual studio Project 6 68
SP result not being displayed 5 69
What is the best SEO Web Analytics tool/program 3 58
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will learn how to count occurrences of each item in an array.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question