Skip to content

Commit

Permalink
Add random highlighting.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdd committed Oct 10, 2011
1 parent 44893e5 commit 7615ac3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions banner.js
@@ -1,8 +1,17 @@
var highlight_random = function() {
$("#banner > span.fg").removeClass("fg");
spans = $("#banner > span");
idx = Math.floor(Math.random()*spans.length);
spans.slice(idx, idx+1).addClass("fg");
};

var rx_programs_cb = function(data, textStatus, jqXHR) {
programs = data.split("\n");
for(i=0; i<programs.length; i += 1) {
$("#banner").append("<span>"+programs[i].slice(0, -1).replace(/ /g, "&nbsp;")+"</span> &emsp;");
}
highlight_random();
setInterval("highlight_random()", 3000);
};

$(function() {
Expand Down

0 comments on commit 7615ac3

Please sign in to comment.