whatman75 (owner)

Revisions

gist: 4709 Download_button fork
public
Public Clone URL: git://gist.github.com/4709.git
Embed All Files: show embed
JavaScript #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function sticky_clicky(list) {
var lis = list.getElementsByTagName('li');
var i = 0;
do
{
lis[i].style.cursor='pointer';
lis[i].addEventListener('click', color_me, false);
i++;
var last = false;
var color_me = function() {
 
if ( !last ) {
this.style.backgroundColor="#ff0000";
} else {
last.style.backgroundColor="";
this.style.backgroundColor="#ff0000";
}
last = this;
}
 
}
while ( i < lis.length )
}