对于框架集,我想使用 onmouseover 从 A 框架的页面打开一个链接,然后在另一个 B 框架中打开它?当鼠标悬停在 A 框架的链接上时,它将在 B 框架上打开页面。给个提示。
问问题
2972 次
1 回答
0
当我使用<frame>
它时需要很长时间(七年或更长时间)。
因为您没有发布任何 html 源代码 :-|,所以我创建了一个理论上的情况:
<html>
<head>
<script type="text/javascript">
function nullRand () {
//document.getElementById("frameBid").src = "myNewInternalPage.html";
document.getElementById("frameBid").src = document.getElementById("frameAid").src;
}
</script>
</head>
<frameset cols="25,*" frameborder="no" border="0" framespacing="0" framepadding="0">
<frame id="frameAid" name="frameAname" src="myHtmlFile.html" noresize>
<frame id="frameBid" name="frameBname" src="" noresize>
</frameset>
</html>
S在我的理论文件“myNewInternalPage.html”中,您必须插入方法调用
<a href="#" onMouseOver="parent.nullRand()">An link</a>
注意:frame
不适合显示外部内容。这就是iframe
存在的原因。
更新:
在与 OP 进行了一场艰苦的战斗后,我得到了一些东西。这是一个解决方案:
第一:用新的替换'nullRand()'中的旧Javascript代码
function nullRand (linkObject)
{
document.getElementById("frameBid").src = linkObject.href; // The new way to access to a frame
//top.frames["center"]..src = linkObject.href; <-- The old way to access to a frame */
}
2nd:修改 a 标签 - 列出无线电流的位置 - 如下:
<a href="the Url from your radiostream" ... onMouseOver="parent.nullRand(this)">...</a>
所以它应该工作。在我看来,您应该为您的任务考虑一个新概念。
于 2012-07-19T15:30:17.667 回答