Permalink
Browse files

Add random highlighting.

  • Loading branch information...
1 parent 44893e5 commit 7615ac3ffdf63e447279a78bf3c12a007db27d02 @mcdd committed Oct 10, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 banner.js
View
@@ -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() {

0 comments on commit 7615ac3

Please sign in to comment.