gpt4 book ai didi

html - img 和 iframe

转载 作者:行者123 更新时间:2023-11-28 02:04:52 25 4
gpt4 key购买 nike

这是我的代码片段

<img src="images/home.jpg" height="40" width="150" />
<img src="images/contact.jpg" height="40" width="150" />

<iframe src="aboutseels.php" scrolling="auto" width="100%" height="360" ></iframe>

现在,我想知道是否有一种方法可以在客户端点击其中一张图片时,iframe 的 src 会发生变化??

例如,如果我点击第二张图片,iframe 的 src 将为 src="contactus.php"

最佳答案

我想你设置了一个 name iframe 上的属性并将图像包装在 a 中标记为 target属性同名。

<iframe name="foo" ...></iframe>
<a href="newlink" target="foo">...</a>

关于html - img 和 iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12122281/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com