<script language="javascript" type="text/javascript">
var cid;
cid=<%=changeid%>;//这三个值都为数字
ispl=<%=ispl%>
var istitle=<%=istitle%>
function changePackage()
{
for (i=1;i<=6;i++)
{
document.getElementById("a"+i).className="" //看不懂了
}
document.getElementById("a"+cid).className="a2"
}
function changeTitle()
{
for (i=1;i<8;i++)
{
document.getElementById("b"+i).className=""
}
document.getElementById("b"+istitle).className="a2"
}
<% if ispl=1 or ispl=2 then %>
changePackage();//调用这个函数有什么用?
<% end if %>
if(istitle>0 && istitle<8)
{
changeTitle();
}
</script>

解决方案 »

  1.   

    将"a"+cid这ID的控件的样式改成a2其他的a+i形式的控件样式置空
      

  2.   

    更改document.getElementById("b"+i)的样式。。
      

  3.   

    for (i=1;i<=6;i++)
    {
    document.getElementById("a"+i).className="" //看不懂了
    }将元素Id为a1或a2或a3或a4或a5或a6的对应的class属性值清空.document.getElementById("a"+cid).className="a2"将id为"a"+cid的元素的class属性赋值为a2,即对该元素应用样式a2(可以在对应的css代码中找到对应的样式: .a2)changePackage();//调用这个函数有什么用?
    这个就是实现上面两步
      

  4.   

    我好像明白了一点,是不是更改样式的。如将name为"b"+istitle的样式更改为a2的样式