-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
22 lines (14 loc) · 701 Bytes
/
README
File metadata and controls
22 lines (14 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Text Prism
By: Sean Canton <sean@8isc.com>
Date: 6/22/11
Version 1
Overview: Changes colors in words using a word index based approach and RGB CSS generation.
Usage:
1) Load JQuery, Load Plugin.
2) Setup word index as array of word positions. ( 'cat' is at index 2 in "The lazy cat snoozed upon the grey sofa" )
EX: var wordIndex = [0, 4, 14];
3) Setup color index as a nested array of RGB values
EX: var colorIndex = [ [0,0,0], [120,120,120], [255,0,0] ];
4) Call the plugin and pass in the settings.
$('#target').textPrism(wordIndex, colorIndex)
This will replace the HTML in #target with psuedo-spans around every word. This is what controls the color through a CSS3 :nth-of-type selector.