将 Div 替换为另一个 Div
我有这件事正在尝试做。我有一张地图的主图片,在该地图中有一些区域。这些区域上有热点,因此您可以单击它们,它将仅用该区域替换整个地图。 (只是一个简单的 div
交换)。
我需要它作为 div
因为在这个 div
中我列出了热点。
我总共需要 4 个 div
来执行此操作。
如果有人能帮助我那就太棒了!
因此,表中列出的链接需要替换单独 div
中的图像。
<tr class="thumb"></tr>
<td>All Regions (shows main map) (link)</td>
</tr>
<tr class="thumb"></tr>
<td>Northern Region (link)</td>
</tr>
<tr class="thumb"></tr>
<td>Southern Region (link)</td>
</tr>
<tr class="thumb"></tr>
<td>Eastern Region (link)</td>
</tr>
</table>
<div>All Regions image</div>
<div>northern image</div>
<div>southern image</div>
<div>Eastern image</div>
我不允许发布图像,因为我没有足够的积分,所以我知道图像链接不起作用。
I have this thing I m trying to do. I have a main picture of a map and within that map there are regions. These regions have hot spots on them so you can click them and it will replace the whole map with only the region. (just a simple div
swap).
I need it as a div
because in this div
i have the hot spots listed.
There are a total of 4 div
s that I am going to need to do this with.
If anyone could help me that would be awesome!
So links that are listed in a table need to replace the image in a separate div
.
<tr class="thumb"></tr>
<td>All Regions (shows main map) (link)</td>
</tr>
<tr class="thumb"></tr>
<td>Northern Region (link)</td>
</tr>
<tr class="thumb"></tr>
<td>Southern Region (link)</td>
</tr>
<tr class="thumb"></tr>
<td>Eastern Region (link)</td>
</tr>
</table>
<div>All Regions image</div>
<div>northern image</div>
<div>southern image</div>
<div>Eastern image</div>
I am not allowed to post images because I don't have enough points so I know the image links wont work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用
.replaceWith()
You can use
.replaceWith()
HTML
JavaScript
HTML
JavaScript
这应该可以帮助您了解
HTML
JavaScript
CSS
This should help you
HTML
JavaScript
CSS