Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Letters won't go away as expected

Posted on 2009-07-10
4
Medium Priority
?
191 Views
Last Modified: 2013-11-19
My problem is in the following web page:

http://www.pinyinology.com/wheel/display/tryAgain2d.html

When clicking a 'display' button, some letters will appear in the cells. and go away when clicking the correspondent 'reset' button.  but some letters in the rectangle do not go.
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
  • 3
4 Comments
 
LVL 5

Accepted Solution

by:
dvz- earned 2000 total points
ID: 24827271
for the forms with only 1 row of boxes, you're calling:

function showIt(){
  lno=0;
  show=1;
  showLetter();
}

And you're also calling "hideIt()":

function showIt(){
  lno=0;
  show=1;
  showLetter();
}

HOWEVER, for the 2 line entry, you're displaying it with the function "show2()":
function show2(){       
       lno=0;
       show=1;
       showLetter();
 
      window.setTimeout(function(){
            lno=0;
             show=1;
            loc++;
             showLetter();
      },300*text2beshown[loc].length)
}

but you're hiding it with "hideIt()" -the one use for single line...

what about creating a function hide2() for that case?  
function hide2(){       
       lno=0;
       show=0;
       showLetter();
 
      window.setTimeout(function(){
            lno=0;
             show=0;
            loc++;
             showLetter();
      },300*text2beshown[loc].length)
}

0
 
LVL 5

Expert Comment

by:dvz-
ID: 24827278
slight adjustment...my copy/paste messed up for copying "hideIt()"...
function hideIt(){
  lno=0;
  show=0;
  showLetter();
}

Just to be consistent.
0
 
LVL 5

Expert Comment

by:dvz-
ID: 24827319
And a side-note - make sure to add a semi-colon to the end of this line as well in show2() and it's counterpart in hide2():

      window.setTimeout(function(){
            lno=0;
             show=1;
            loc++;
             showLetter();
      },300*text2beshown[loc].length)

0
 

Author Closing Comment

by:fuli3665
ID: 31602268
good solution.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

722 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