【问题标题】:How to make anchors of iframe to be opened in the parent window如何使 iframe 的锚点在父窗口中打开
【发布时间】:2015-11-08 07:21:25
【问题描述】:

我正在尝试    

在同一个父页面中打开链接,而不是在新页面中打开它。

注意

iframe 和父页面是同一个域。

iframe 代码

<div id="phase"> <iframe src="worksheader.html"  name="myiFrame" scrolling="no" frameborder="0"  height="100%" width="100%"></iframe> <iframee src="http://www.ahmadalanazi.com"  name="myiFrame" scrolling="no" frameborder="0"  height="100%" width="100%"></iframe> </div>

超链接元素的代码

<a target="_parent" href="#my-id">Jump to anchor/a>

EXAMPLE HERE

【问题讨论】:

  • 您的问题中没有发布示例代码。您也可以尝试在这里提问:webmasters.stackexchange.com
  • 请各位。我被困在这个!它改变了生活。

标签: iframe scroll header height anchor


【解决方案1】:

您的描述让您有点难以理解您要完成的工作,但如果您要实现平滑滚动,那么此链接将对您有所帮助:

https://css-tricks.com/snippets/jquery/smooth-scrolling/

为此你需要 jQuery。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-21
    • 2017-07-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-05
    相关资源
    最近更新 更多