I would like to generate multicoloured text for various links, with a random assignment of colours to individual letters, from a pre-specified array of colours, which would chan
Ok i whip up an example using jquery.
first your text
Multi color me
then the javascript:
$(document).ready(function() {
var test = $("#example").text().split('');
var result = "";
var i = 0;
for(i=0; i < test.length; i++) {
result += ""+test[i]+"";
}
$("#example").html(result);
});
function getColor() {
var colList = ['#00FF00', '#FF0000','#0000FF'];
var i = Math.floor((Math.random()*colList.length));
return colList[i];
}
Heres the jsFiddle Example
Note: i did not do the hover but I guessing you can take it from here :)