动态更改最低帧

发布于 2024-12-27 01:30:32 字数 650 浏览 2 评论 0原文

我有一个包含 3 个框架的页面,顶部、中间和底部,每个框架中显示不同的页面。当我单击中间框架上的按钮时,我想更改第三框架。

主页:

<html>
<frameset rows="475,6%,*">
  <frame name="top" scrolling="no" noresize target="middle" src="top.htm">
  <frame name="middle" src="middle.htm" scrolling="no" noresize>
  <frame name="bottom" src="bottom.htm" scrolling="no" noresize>
  <noframes>
  <body>

  <p>This page uses frames, but your browser doesn't support them.</p>

  </body>
  </noframes>
</frameset>

我要做的是在 middle.htm 页面中设置一个按钮,这样当单击它时,底部框架现在将显示不同的页面。

知道如何设置吗?

TIA

BR

I have a page with 3 frames, top, middle, and bottom that display a different page in each frame. I'd like to change what is third frame when I click a button on the middle frame.

Main Page:

<html>
<frameset rows="475,6%,*">
  <frame name="top" scrolling="no" noresize target="middle" src="top.htm">
  <frame name="middle" src="middle.htm" scrolling="no" noresize>
  <frame name="bottom" src="bottom.htm" scrolling="no" noresize>
  <noframes>
  <body>

  <p>This page uses frames, but your browser doesn't support them.</p>

  </body>
  </noframes>
</frameset>

What I'd to do is setup a button in the middle.htm page so that when it is clicked the bottom frame will now display a different page.

Any idea how to set this up?

TIA

BR

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

送你一个梦 2025-01-03 01:30:32

尝试 top.document.getElementsByName( "bottom" )[ 0 ].src = "YOUR_NEW_PAGE"

Try top.document.getElementsByName( "bottom" )[ 0 ].src = "YOUR_NEW_PAGE"

一曲琵琶半遮面シ 2025-01-03 01:30:32

我不建议使用框架,但你可以尝试这个:

<script>
function changePage(strPage)
{
parent.middle.location.href = strPage; 
}
</script>

<a href="javascript:void(0);" onClick="changePage('page1.htm')">Page 1</a>   
<a href="javascript:void(0);" onClick="changePage('page2.htm')">Page 2</a>   
<a href="javascript:void(0);" onClick="changePage('page3.htm')">Page 3</a>   
<a href="javascript:void(0);" onClick="changePage('body.htm')">Home</a>

I do not recommend using frames, but you can try this:

<script>
function changePage(strPage)
{
parent.middle.location.href = strPage; 
}
</script>

<a href="javascript:void(0);" onClick="changePage('page1.htm')">Page 1</a>   
<a href="javascript:void(0);" onClick="changePage('page2.htm')">Page 2</a>   
<a href="javascript:void(0);" onClick="changePage('page3.htm')">Page 3</a>   
<a href="javascript:void(0);" onClick="changePage('body.htm')">Home</a>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文