HTML 和 iFrame

标签 html css iframe frames

好的,问题是当您单击左侧 iframe 中的链接时,我希望它在右侧 iframe 中打开。当您第一次单击左侧边栏中的链接时,这一切都很好。但是,当您第二次单击该链接(在左侧边栏中)时,它将在新的浏览器选项卡中打开。我怎样才能让它在正确的框架中不断打开?

提前致谢, 和平

index.html http://pastebin.com/u6DqDA1q

left_frame.html http://pastebin.com/UuZYtdYs

最佳答案

是的,它应该工作得很好,iframe 1 中的链接需要有目标等于目标 iframe 的名称。

例如:

内嵌框架 1

<iframe src=""></iframe>

目标 iframe

<iframe name="iframe2"></iframe>

Iframe 1 的内容

<a href="" target="iframe2">Link opens in iframe 2</a>

同时检查我找到的这个链接

http://www.trans4mind.com/personal_development/HTMLGuide/iframes3.htm

关于HTML 和 iFrame,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13918872/

相关文章:

javascript - 神秘阴影图像是 HTML/CSS/Javascript

html - 如何在 iframe 中引用类

javascript - 无法使用 'in' 运算符在...中搜索 'length' 需要更改字符串吗?

html - HTML + CSS 样式中的 <a> 标签问题

iframe - 在来自不同域的 iframe 中运行 Meteor 应用程序

javascript - JS从键盘事件中读取变量

javascript - 将类更改为悬停类

css - 如何单独使用 CSS 为 IE 和 Firefox 获取奇数/偶数着色?

javascript - 如何从 Internet Explorer 获取在 JavaScript 中打开窗口的 iframe?

javascript - 如何将 IFrame 高度更改为其内容的 100%?