【www.gdgbn.com--网页配色】
1
2
3
4
5
6
7
8
9
<script type="text/javascript">
// // by MacJi
function f(c){
this.container = document.getElementById(c);
this.li = this.container.getElementsByTagName("a");
var _this = this;
this.init = function (){
for(var i = 0; i < _this.li.length; i++)_this.li[i].onclick = function(){_this.setOn(this);return this.blur()};
}
this.setOn = function(o){
for(var i = 0; i < _this.li.length; i++) _this.li[i].className = "";
o.className = "on";
}
}
var page = new f("test");
page.init();
// ]]>
</script>