62,046
社区成员
发帖
与我相关
我的任务
分享
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="fundraising.Site1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<script type="text/javascript" language="javascript">
window.onload = function () {
var url = document.location.href;
var a = document.getElementById("daohang").childNodes;
for (var i = 0; i < a.length; i++) {
if (a[i].href == url) {
a[i].style.background = "red";
}
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="daohang" style=" margin-bottom:50px;">
<a href="a.aspx" style=" background:yellow;">a 页面</a> <a href="b.aspx" style=" background:yellow;">b 页面</a>
</div>
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
<script type="text/javascript">
function select(object)
{
var li = document.getElementById("menu").getElementsByTagName("li");
for(i=0;i<li.length;i++)
{
li[i].className="none";
}
object.className="yesImg";
}
</script>