Solved

Letters won't go away as expected

Posted on 2009-07-10
4
190 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 500 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
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 fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

623 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