Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8901175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:16:56+00:00 2026-06-15T01:16:56+00:00

Edit: I didn’t really ask all the questions I should have asked in my

  • 0

Edit: I didn’t really ask all the questions I should have asked in my original question. To help make this easier for people looking for a similar answer, this is what the question ended up being:

How do I make a typewriter effect with a blinking cursor that pauses at the end of the statement, erases the statement, and writes a new one?

Check out Yoshi’s answer below. It does exactly that…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:16:57+00:00Added an answer on June 15, 2026 at 1:16 am

    demo: http://jsbin.com/araget/5/

    /*** Plugin ***/
    
    (function($) {
      // writes the string
      //
      // @param jQuery $target
      // @param String str
      // @param Numeric cursor
      // @param Numeric delay
      // @param Function cb
      // @return void
      function typeString($target, str, cursor, delay, cb) {
        $target.html(function(_, html) {
          return html + str[cursor];
        });
    
        if (cursor < str.length - 1) {
          setTimeout(function() {
            typeString($target, str, cursor + 1, delay, cb);
          }, delay);
        } else {
          cb();
        }
      }
    
      // clears the string
      //
      // @param jQuery $target
      // @param Numeric delay
      // @param Function cb
      // @return void
      function deleteString($target, delay, cb) {
        var length;
    
        $target.html(function(_, html) {
          length = html.length;
          return html.substr(0, length - 1);
        });
    
        if (length > 1) {
          setTimeout(function() {
            deleteString($target, delay, cb);
          }, delay);
        } else {
          cb();
        }
      }
    
      // jQuery hook
      $.fn.extend({
        teletype: function(opts) {
          var settings = $.extend({}, $.teletype.defaults, opts);
    
          return $(this).each(function() {
            (function loop($tar, idx) {
              // type
              typeString($tar, settings.text[idx], 0, settings.delay, function() {
                // delete
                setTimeout(function() {
                  deleteString($tar, settings.delay, function() {
                    loop($tar, (idx + 1) % settings.text.length);
                  });
                }, settings.pause);
              });
    
            }($(this), 0));
          });
        }
      });
    
      // plugin defaults  
      $.extend({
        teletype: {
          defaults: {
            delay: 100,
            pause: 5000,
            text: []
          }
        }
      });
    }(jQuery));
    
    
    /*** init ***/
    
    $('#target').teletype({
      text: [
        'Lorem ipsum dolor sit amet, consetetur sadipscing elitr,',
        'sed diam nonumy eirmod tempor invidunt ut labore et dolore',
        'magna aliquyam erat, sed diam voluptua. At vero eos et',
        'accusam et justo duo dolores et ea rebum. Stet clita kasd',
        'gubergren, no sea takimata sanctus est Lorem ipsum dolor sit',
        'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,',
        'sed diam nonumy eirmod tempor invidunt ut labore et dolore',
        'magna aliquyam erat, sed diam voluptua. At vero eos et accusam',
        'et justo duo dolores et ea rebum. Stet clita kasd gubergren,',
        'no sea takimata sanctus est Lorem ipsum dolor sit amet.'
      ]
    });
    
    $('#cursor').teletype({
      text: ['_', ' '],
      delay: 0,
      pause: 500
    });
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    
    <span id="target"></span>
    <span id="cursor"></span>
    <!-- used for the blinking cursor effect -->

    plugin:

    (function ($) {
      // writes the string
      //
      // @param jQuery $target
      // @param String str
      // @param Numeric cursor
      // @param Numeric delay
      // @param Function cb
      // @return void
      function typeString($target, str, cursor, delay, cb) {
        $target.html(function (_, html) {
          return html + str[cursor];
        });
        
        if (cursor < str.length - 1) {
          setTimeout(function () {
            typeString($target, str, cursor + 1, delay, cb);
          }, delay);
        }
        else {
          cb();
        }
      }
      
      // clears the string
      //
      // @param jQuery $target
      // @param Numeric delay
      // @param Function cb
      // @return void
      function deleteString($target, delay, cb) {
        var length;
        
        $target.html(function (_, html) {
          length = html.length;
          return html.substr(0, length - 1);
        });
        
        if (length > 1) {
          setTimeout(function () {
            deleteString($target, delay, cb);
          }, delay);
        }
        else {
          cb();
        }
      }
    
      // jQuery hook
      $.fn.extend({
        teletype: function (opts) {
          var settings = $.extend({}, $.teletype.defaults, opts);
          
          return $(this).each(function () {
            (function loop($tar, idx) {
              // type
              typeString($tar, settings.text[idx], 0, settings.delay, function () {
                // delete
                setTimeout(function () {
                  deleteString($tar, settings.delay, function () {
                    loop($tar, (idx + 1) % settings.text.length);
                  });
                }, settings.pause);
              });
            
            }($(this), 0));
          });
        }
      });
    
      // plugin defaults  
      $.extend({
        teletype: {
          defaults: {
            delay: 100,
            pause: 5000,
            text: []
          }
        }
      });
    }(jQuery));
    

    html:

    <span id="target"></span>
    <span id="cursor"></span> <!-- used for the blinking cursor effect -->
    

    init:

    $('#target').teletype({
      text: [
        'Lorem ipsum dolor sit amet, consetetur sadipscing elitr,',
        'sed diam nonumy eirmod tempor invidunt ut labore et dolore',
        'magna aliquyam erat, sed diam voluptua. At vero eos et',
        'accusam et justo duo dolores et ea rebum. Stet clita kasd',
        'gubergren, no sea takimata sanctus est Lorem ipsum dolor sit',
        'amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr,',
        'sed diam nonumy eirmod tempor invidunt ut labore et dolore',
        'magna aliquyam erat, sed diam voluptua. At vero eos et accusam',
        'et justo duo dolores et ea rebum. Stet clita kasd gubergren,',
        'no sea takimata sanctus est Lorem ipsum dolor sit amet.'
      ]
    });
    
    $('#cursor').teletype({
      text: ['_', ' '],
      delay: 0,
      pause: 500
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

edit: I completely rewrote the question as the original one didn't clearly explain my
Edit: I didn't mean to pinhole this question to a specific executable. I want
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
Edit (updated question) I have a simple C program: // it is not important
Edit: This didn't work because I had: class Animal { ... } class Horse
EDIT: I didn't post my XML for this dialog. <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android
Yesterday the application was working normally, and i didn't edit my codes. But now
Edit Since there were many downvotes and people who didn't understand what I'm asking
EDIT: See my answer below--> I am wanting to have a view that when
EDIT : It turned out that this can only be done through an external

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.