Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 )
- }
Add Comment
Please, Sign In to add comment