GithubHelp home page GithubHelp logo

scramble's Introduction

scramble

A jQuery plugin that scrambles from one text to the next. Allows for multi-colored multi-element text.

Demo

plugins.getdans.info/scramble

Installation

Download from GitHub

Requirements

jQuery

Use

<script>
    $(document).ready(function(){
        $('.display-word').scramble({
            textClass: '.word'
        });
    });
</script>

Description

You must call scramble on an empty container where you would like the words to appear. You MUST define a textClass in order for scramble to work. Each text must be within a <span> element within the container with the textClass. This allows for multi-colored phrases to be used. For example, if you want a phrase with two different colors, you can use
<div class="textClass"><span>Phrase color one </span><span>phrase color two.</span></div>.

Example

<div class="display-word"></div>
<ul>
    <li class="word"><span>Word 1.</span></li>
    <li class="word"><span>Phrase </span><span>one</span></li>
    <li class="word"><span>Word 2.</span></li>
    <li class="word"><span>Word 3.</span></li>
    <li class="word"><span>Word 4.</span></li>
</ul>

<script>
    $(document).ready(function(){
        $('.display-word').scramble({
            textClass: '.word'
        });
    });
</script>

Options

Options Definition
textClass (required)
Class of the word containers.
The words will appear in the order they are in the DOM.
possible Possible string scramble can pull from before displaying the correct letter.
Does not have to include the letters in the string it is displaying.
default: 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'
frames Scramble uses requestAnimationFrame to go through the possible string.
This is the number of frames scramble will go through before finding another random letter from possible.
default: 0
startTime Delay before scramble starts, in milliseconds.
default: 5000
interval Time between when a word is revealed and when it is scrambled again for the next word to be displayed.
default: 5000

scramble's People

Contributors

leeroyjenks avatar

Watchers

James Cloos avatar  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.