87,904
社区成员
发帖
与我相关
我的任务
分享
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
.main{width:1000px; height:500px;}
.left{width:300px;height:400px; background-color:#0033FF;float:left; }
.right{width:700px;height:400px; background-color:#006633; float:left;}
.top{width:1000px;height:100px; background-color:#0099FF; text-align:right; padding-right:200px; padding-top:50px;}
</style>
</head>
<body>
<div class="main">
<div class="top" id="biaoti">
</div>
<script>
function s(v){
document.getElementById('biaoti').innerHTML = v;
// document.getElementById('#mainframe').setAttribute('src',t);return false;
}
</script>
<div class="left">
<ul>
<li><a href="guahao.html" target="mainframe" onclick="s('这是标题1')">11</li>
<li><a href="2.html" target="mainframe" onclick="s('这是标题2')">22</li>
<li><a href="3.html" target="mainframe" onclick="s('这是标题3')">33</li>
<li><a href="4.html" target="mainframe" onclick="s('这是标题4')">44</li>
</ul>
</div>
<div class="right">
<iframe name="mainframe" id="mainframe" src="index.html" frameborder="no" scrolling="auto" width="100%" height="auto" allowtransparency="true"></iframe>
</div>
</div>
</body>
</html>
可以实现
但是在服务器控件无用啊
<ul>
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<li><a href="<%#Eval("Module_Url")%>" target="mainframe" OnClientClick="s('<%#Eval("Operation_name")%>')"><%#Eval("Operation_name")%></a></li>
</ItemTemplate>
</asp:Repeater>
</ul>
//函数定义
function show() {
document.getElementById("TopControl1_menuname").innerText = document.getElementById("menu_name").innerText;
}
//栏目调用
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<li><a href="<%#Eval("Module_Url")%>" target="mainframe" id="menu_name" onclick="show();"><%#Eval("Operation_name")%></a></li>
</ItemTemplate>
</asp:Repeater>
//获取值处标签定义
<div id="here_area" class="fl">当前位置: <asp:Label ID="menuname" runat="server" ></asp:Label> </div>
问题:每次点不同链接名称, 始终显示第一行那个链接名称