开发者

External Navigation for navigating inside an iFrame

开发者 https://www.devze.com 2023-02-05 19:23 出处:网络
After all the time of staying away from things like iframes, it finally caught back on me. A client wants a part of his Shop showing on his website, via iFrame.

After all the time of staying away from things like iframes, it finally caught back on me. A client wants a part of his Shop showing on his website, via iFrame.

But lets just skip right to the problem:

There is the main html site, which holds the iframe displaying the shop. Above that iframe, there is a submenu, which is supposed开发者_StackOverflow to open links INSIDE the iframe.

The problem is, that I don't have any clue how to do that. Is there a way of using anchors to switch / navigate sites inside an iframe?

Thanks in advance, I hope you guys can help me with this.


Give the iframe a name attribute (e.g. name="shopContent"). You can then make links access the iframe using the target attribute on your link element:

<a href="bananas.htm" target="shopContent">Bananas</a>
0

精彩评论

暂无评论...
验证码 换一张
取 消