Advanced Search

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: Typing text

  1. #11
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    262
    Thanked 690 Times in 678 Posts

    Default

    Shouldn't be too hard, I suppose... just adding a function on the occurance of a line-break character in the inputted text... would require a bit of scripting, though.
    Not my area, sorry... someone should know.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  2. #12
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The script I posted here is now obsolete. I wrote a better version, with support for HTML tags and entities, and DD accepted it and deleted the old one.
    Using the old version, it's actually fairly tricky. Using the new version, this is simple enough:
    Code:
        } else if(this.origText.charAt(this.currentChar) == ">" && this.inTag) {
          this.tagBuffer += ">";
          this.inTag = false;
          this.currentText += this.tagBuffer;
          this.currentChar++;
          if(this.tagBuffer != "<br>") this.run();
          else window.setTimeout(this.run, 1000);
          return;
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #13
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    262
    Thanked 690 Times in 678 Posts

    Default

    Gah. You can ignore my post above... somehow I missed all of the posts... didn't realize there were any responses. Maybe I hadn't refreshed in a while.

    Anyway, glad Twey figured it out.

    //leaving now.
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  4. #14
    Join Date
    Sep 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
        } else if(this.origText.charAt(this.currentChar) == ">" && this.inTag) {
          this.tagBuffer += ">";
          this.inTag = false;
          this.currentText += this.tagBuffer;
          this.currentChar++;
          if(this.tagBuffer != "<br>") this.run();
          else window.setTimeout(this.run, 1000);
          return;

    This doesn't seem to work for me - I get "Error: this.element has no properties" and it stops after the first line (when it gets to the first <br>.)

    Any suggestions? I'm actually trying not only to have it pause for X milliseconds after each line, but clear each line and type the next in its place, which is also proving to be finicky...

  5. #15
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Try:
    Code:
          if(this.tagBuffer != "<br>") this.run();
          else {
            var me = this;
            window.setTimeout(function(){me.run();}, 1000);
          }
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #16
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Hi ,

    I'm sorry that my first post is asking for some thing
    All what I need that when the first line ends I want it to be replaced with another line then the other line with another one .....and so on for X of times , and when lines finished it's repeated again .

    Can that be done ?

  7. #17
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
          if(this.tagBuffer != "<br>") this.run();
          else {
            var me = this;
            this.currentText = "";
            this.currentChar = 0;
            window.setTimeout(function(){me.run();}, 1000);
          }
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #18
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    You have to explain to the OP to add this to the script rather than just replacing, correct?
    - Mike

  9. #19
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    If s/he's read through the rest of the thread, s/he should know what to do.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #20
    Join Date
    Jan 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Red face

    Hi ,

    Thanks alot for replying me ..
    I know that I might be look like an idiot but I really didn't know what to do with the code you gave to me ..
    And I really readed the whole thread many times ..

    So would you please give me the full modified script code and tell me where to put my lines 1,2,3 etc...


    Thanks alot ..

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •