Solved

Letters won't go away as expected

Posted on 2009-07-10
4
182 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
  • 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

772 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