Deutsche Version kommt irgendwann ;)

Effect.Numb3rs

Ok, I confess, I watched Numb3rs, that dumb TV series about that mathematician, who solves the funniest problems with mathematical calculations. Oh my God, that series is the height of silliness on TV. But it inspired me to create this simple script.aculo.us effect.

renumb3r | renumb3r fast | fast3r | long3r

Installation

Simply embed numb3rs.js (download via right click)after embedding Prototype and Scriptaculous using <script>-Tags:

<script type="text/javascript" src="js/scriptaculous/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous/scriptaculous.js"></script>
<script type="text/javascript" src="js/numb3rs.js"></script>

Now you can use the Effect.Numb3rs effect.

Usage

Simply type

new Effect.Numb3rs(element);

or

new Effect.Numb3rs(element, options);

element specifies the id of the element or the element itself that contains the text for the Numb3r-effect. The optional options attribute contains a JSON object with the Options shown below.

Demo/Options

Demo 1

new Effect.Numb3rs('demo_1', {duration:3});

Just a simple Numb3r-effect with a duration of 3 seconds (standard: 5). Try it.

The quick brown fox jumps over the lazy dog

Demo 2

new Effect.Numb3rs('demo_1', {numb3rColor:'#00cc00', restoreColor:'#ffcc00'});

Numb3r-effect with a different color for the numb3rs and the normal text of 3 seconds (standard: 5). Try it.

The quick brown fox jumps over the lazy dog

Demo 3

new Effect.Numb3rs('demo_3', {fps:5});

Numb3r-effect with 5 frames per second (standard: 15). Try it.

The quick brown fox jumps over the lazy dog

Licence

Copyright (c) 2008 Thomas Lemmé

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments

If you have got questions, suggestions or any other comments, post them on the entry on my blog web/code.

About

Effect.Numb3rs was created by Thomas Lemmé.

It has been tested and works quite fine forFirefox 3, Opera 9, Safari ? on Windows and Internet Explorer 6.

Changelog:

Date Version Changes/Notes
1.9.2008
1.0
Initial release... Everything is new today ;)