GithubHelp home page GithubHelp logo

jq.typewrite's Introduction

jq.typewrite

This method gives a basic typewrite effect to a target element.

Usage

Basic

script

var typewrite1 = $.typewrite($('#typewrite1'));
$('#do_typewrite1').click(function() {
  typewrite1.play();
});

HTML

<p id="typewrite1">This is typewrite</p>
<p>
  <input type="button" id="do_typewrite1" value="Do typewrite 1">
</p>

With options and using deferred

script

var typewrite2 = $.typewrite($('#typewrite2'), {
	duration: 2,
	hide: false,
	end: '|'
});
$('#do_typewrite2').click(function() {
	typewrite2.play().done(function() {
		alert('completed');
	});
});

HTML

<p id="typewrite2">This is typewrite<br>
This is typewrite</p>
<p>
  <input type="button" id="do_typewrite2" value="Do typewrite 2">
</p>

Using as a jQuery plugin

Using as a jQuery plugin, a 'play()' method call as a 'typewritePlay()' method.

script

var typewrite4 = $('#typewrite4').typewrite({
  end: '|'
});
$('#do_typewrite4').click(function() {
  typewrite4.typewritePlay(2);
});

HTML

<p id="typewrite4">Using as a jQuery plugin</p>
<p>
  <input type="button" id="do_typewrite4" value="Do typewrite 4">
</p>

Options (Use as a method

  • duration - duration time (def 1, 1 => 1s
  • hide - default text showing option (def true
  • end - typing cursor (def _(underscore
  • wait - when target characters, adding wait time (def next

wait (デフォルトは日本語全角のみ

  • ! - 0.1
  • ? - 0.1
  • 、 - 0.1
  • 。 - 0.1

jq.typewrite's People

Contributors

5509 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.