Solved

Letters won't go away as expected

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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.

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now