Coder Social home page Coder Social logo

jquery-splitflap's Introduction

jquery-splitFlap

jQuery module to transform a div text into splitflap display (airport-like).

View the Demo โ†’

How to use

<div class="my-splitflap">Hello World</div>
$('.my-spliflap').splitFlap();

Options

You can pass options to the function

// Default :
$('.my-spliflap').splitFlap({
	image:          'images/chars.png',
	imageSize:      '',
	charsMap:       'ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789.,!?#@()+-=',
	charWidth:      50,
	charHeight:     100,
	charSubstitute: ' ',
	speed:          3,
	speedVariation: 2,
	text:           '',
	textInit:       '',
	autoplay:       true,
	onComplete:		function(){}
});

image

The path to the image used by the splitflap.

imageSize

If used on a non-natural size (ie for HDPI, etc...), the size of the image can be specified here, in CSS "background-position" format.

You will certainly need to change charsMap, charWidth and charHeight if you change this.

charsMap

The string represented in the image.

charWidth

The width of a character in the image, in pixels.

charHeight

The height of a character in the image, in pixels.

charSubstitute

The character used when the string contains a character not found in the charsMap.

speed

The speed of the rotation, in letter by seconds.

speedVariation

Random speed added to the fixed speed.

text

The destination text. If empty, the content of the element is used.

textInit

The initial string the animation begin with.

autoplay

If set to false, you'll need to start the animation manually (see below).

onComplete

Callback function when the aniamtion is complete.

Special options

If the string 'splitflap' is passed as options on an already existing Splitflaped div, the internal SplitFlap object is returned.

With this object, you can start the animation manually by calling the animate() method.

// Initialise the animation
$('.my-spliflap').splitFlap({autoplay: false});

// Get the animation object and start it manually
$('.my-spliflap').splitFlap('splitflap').animate();

jquery-splitflap's People

Contributors

zemax avatar

Watchers

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