Solved

Letters won't go away as expected

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

760 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

21 Experts available now in Live!

Get 1:1 Help Now