フレームセットの場合、Aフレームのページからonmouseoverでリンクを開き、別のBフレームで開きたいのですが? Aフレームのリンクにマウスオーバーすると、Bフレームのページが開きます。ヒントを与える。
2972 次
1 に答える
0
私が取り組んだとき<frame>
は、かなり前に(7年以上)かかりました。
あなたは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>
私の理論上のファイル「myNewInternalPage.html」では、メソッド呼び出しを挿入する必要があります
<a href="#" onMouseOver="parent.nullRand()">An link</a>
注:frame
外部コンテンツを表示するのは適切ではありません。だからこそiframe
存在する。
アップデート:
OPとの激しい戦いの後、私は何かを手に入れました。ここに解決策があります:
1つ目: 「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 */
}
2 番目: 次のように a タグ (ラジオ ストリームがリストされている場所) を変更します。
<a href="the Url from your radiostream" ... onMouseOver="parent.nullRand(this)">...</a>
だからうまくいくはずです。私の目には、あなたは自分の仕事の新しい概念について考えるべきです.
于 2012-07-19T15:30:17.667 に答える