<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>无标题文档</title>
<style> .listyle1 { background: url(images/col_23.jpg) no-repeat left; } .listyle2 { background: url(images/col_11.jpg) no-repeat left; } .a1 { color: blue; padding-left:20px; } .a2 { color: red; padding-left:20px; } </style> <script> //函数功能:点击li,改变li的前缀图标和li的样式 //5个参数 //name:要点击的元素id //cursel:当前点击的元素 //n:所有可以点击的元素数 //cla1:前缀图标样式 //cla2:超链接样式 //ul:下级列表 function setTab(name, cursel, n, cla1,cla2) { for (i = 1; i <= n; i++) { var prepic = document.getElementById(name + i); prepic.className = i == cursel ? cla1 : "listyle1"; var aa = document.getElementById("a_" + name + "_" + i); aa.className = i == cursel ? cla2 : "a1"; } } </script> </head>