Weasel
👄 I'd intercept me
So this script is an improved version of the one @RastaLulz uses on DevBest for the christmas style usernames.
You can define the selector of the elements you want to change the text to christmas style in the function call (currently p.christmas).
Enjoy!
Code:
$.fn.christmas = function() {
$(this).each(function() {
$(this).html($(this).text().split("").map(function(v, i) {
return '<span class="christmas-' + (i % 2 == 0 ? 'red' : 'green') + '">' + v + '</span>';
}).join(""));
});
};
$(document).ready(function() {
$(function() {
$('p.christmas').christmas();
});
});
Code:
.christmas-green {
color: #008000;
}
.christmas-red {
color: #D81E1E;
}
You can define the selector of the elements you want to change the text to christmas style in the function call (currently p.christmas).
Enjoy!