比方:有左右两个框架页,左框架有5个链接,右框架是显示区,点击左边的链接右边是跳到相应的页面,左边页面是不跳转的,要求是:原先左边的连接颜色是蓝色,点击后变成红色,只要求有一个是红色的, 那就是当前链接。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
a{
width:100; color:blue;
}
a:hover{
background-color: #d9d9f9;
}
a:active{
color: red;
}
</style>
</head>
<body>
<a href="a.htm" target="左边框架的name">aa</a><br>
<a href="b.htm" target="左边框架的name">bb</a><br>
<a href="c.htm" target="左边框架的name">cc</a><br>
</body>
</html>
给你个例子,已经测试过了
3个文件
主文件1.htm
<frameset cols=80,*>
<frame name=a123 src="2.htm">
<frame name=b123 src="4.htm">
</frameset>
左面文件
2.htm
<script language=javascript>
function a123(e)
{
for(i=0;i<document.all.b1.length;i++)
{
document.all.b1[i].style.color="#000000";
}
e.style.color="#ff0000"
top.b123.location.href="5.htm"
}
</script>
<a href=# id=b1 onclick=a123(this)>链接1</a>
<a href=# id=b1 onclick=a123(this)>链接2</a>
<a href=# id=b1 onclick=a123(this)>链接3</a>
<a href=# id=b1 onclick=a123(this)>链接4</a>
<a href=# id=b1 onclick=a123(this)>链接5</a>
右面文件
4.htm
随便
5.htm
随便